乔山办公网我们一直在努力
您的位置:乔山办公网 > excel表格制作 > matlab怎么实现从excel表格中读取数据,并且读取数据...-matlab从excel读取数据,matlab读取e

matlab怎么实现从excel表格中读取数据,并且读取数据...-matlab从excel读取数据,matlab读取e

作者:乔山办公网日期:

返回目录:excel表格制作


没看懂你的格式是什么意思,
不过我一般读取excel都用xlsread函数,你也可以试一试
[a,b,c]=xlsresd('data.xls');%r如果office2007及以上。那就是data.xlsx
a b c 是读取不同的数据类型

用 xlsread 函数 num = xlsread(filename, sheet)
for i=1:100
SheetName=['sheet',num2str(i)];
data(i)={xlsread('e:/shiyanshuju/shiyanbiaoge',SheetName,'b1:d1440')};
%data是一个元胞copy数组,当然也可以用矩阵
end
==========================================================
读入到一个矩阵data里
data=[];
for i=1:100
SheetName=['sheet',num2str(i)];
data=[data,xlsread('e:/shiyanshuju/shiyanbiaoge',SheetName,'b1:d1440')];
end

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

第二种方法,就是把字符转化为数字,使用函数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.

祝你学习愉e79fa5e98193e59b9ee7ad94331快!

相关阅读

关键词不能为空
极力推荐
  • excel行列转换-Excel行列如何转换

  • 如果在日常办公中,一行内容太多,想要换成一列该怎么办呢。[]举的例子可能内容太少看不出什么来,如果内容多,可以大大节省时间。-excel行列转换

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