乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > 请问matlab如何从excel表格中读取数据,谢谢-从excel读取数据,excel怎么自动提取有用数据

请问matlab如何从excel表格中读取数据,谢谢-从excel读取数据,excel怎么自动提取有用数据

作者:乔山办公网日期:

返回目录:excel表格制作


xlsread name.xlsx
name是文件名,xlsx是文件后缀名07的excel是这个后缀名,最后是路径了,在主界面工具栏那有个数地址的地,选择你放文件的盘

第一种方法,你可以使用xlsread函数来读取excel中的数据e68a84e799bee5baa6e997aee7ad94331

第二种方法,就是把字符转化为数字,使用函数str2num

xlsread的使用
EXAMPLES:
1. Default operation:
NUMERIC = xlsread(FILE);
[NUMERIC,TXT]=xlsread(FILE);
[NUMERIC,TXT,RAW]=xlsread(FILE);

2. Get data from the default region:
NUMERIC = xlsread('c:\matlab\work\myspreadsheet')

3. Get data from the used area in a sheet other than the first sheet:
NUMERIC = xlsread('c:\matlab\work\myspreadsheet','sheet2')

4. Get data from a named sheet:
NUMERIC = xlsread('c:\matlab\work\myspreadsheet','NBData')

5. Get data from a specified region in a sheet other than the first
sheet:
NUMERIC = xlsread('c:\matlab\work\myspreadsheet','sheet2','a2:j5')

6. Get data from a specified region in a named sheet:
NUMERIC = xlsread('c:\matlab\work\myspreadsheet','NBData','a2:j5')

7. Get data from a region in a sheet specified by index:
NUMERIC = xlsread('c:\matlab\work\myspreadsheet',2,'a2:j5')

8. Interactive region selection:
NUMERIC = xlsread('c:\matlab\work\myspreadsheet',-1);
You have to select the active region and the active sheet in the
EXCEL window that will come into focus. Click OK in the Data
Selection Dialog when you have finished selecting the active region.

祝你学习愉快!

将excel表格中大量数据导入matlab中并作图的步骤如下:

1.打开matlab,点击主页下面导入数据,可以导入excel数据,在此将自己命名的huitushuju文件导入。

2.点击打开按钮,即可将数据导入。

3.鼠标选中Varname1所有数据,右键弹出下拉菜单,选择导入所选内容,即可将数据导入matlab工作空间,同理可以将另外两个变量也导入。

4.依次将三列数据分别导入matlab空间如下,在工作空间会看到这三个变量,并知道三个变量的最大值及最小值。

5.在此将其重新命名为X,同理将Varname2和Varname3分别命名为Y1,Y2。

6.此时在命令区域,编写如下程序:

plot(X,Y1,'r-');

hold on;

plot(X,Y2,'b-.');

xlabel('时间/s');

ylabel('距离/m');

运行该程序,即可绘制所需要的曲线了。这样就解决了将excel表格中大量数据导入matlab中并作图的问题了。



第一种方法,使用xlsread函数来读取excel中的数据

第二种方法,就是把字符转化为数字,使用函数str2num


相关阅读

关键词不能为空
极力推荐

ppt怎么做_excel表格制作_office365_word文档_365办公网