其主要的调用形式为:a=xlsread('filename.xls');
num =
xlsread(filename,sheet,xlRange)
%num =
xlsread('filename',sheet,'xlRange')filename为文件路径及文件名称,sheet为某表的序号如sheet1为1,sheet为2。xlRange为选着需要读取的数据的范围如B2:D4
filename = 'myExample.xlsx';
sheet = 1;
xlRange = 'B2:C3';
subsetA = xlsread(filename,sheet,xlRange)
subsetA =
2 3
5 NaN
xlswrite(filename,A,sheet,xlRange)
如:xlswrite('filename.xlsx',A,1,'B1:B4');此函数运行后会在当前代码存储路径产生一个filename.xlsx文件
filename = 'testdata.xlsx';
A = {'Time','Temperature'; 12,98; 13,99; 14,97};
sheet = 2;
xlRange = 'E1';