求一本在matlab导入excel数据里面实现excel的书~

改编了一个将&text&文本写入&excel&里的&matlab&函数
&今天花了大半天的时间修改了一个将 text 文本写入 excel 里的 matlab
函数,原来不能读纯文本该后可以读了.数据和文本可以一块读进 excel 里,对数据处理非常方便.
另外,把原来只能读matlab当前路径,该为了可以读任何路径,并且能保存到任何路径里去.还有其他方面,不便细说,有兴趣的话,看看便知晓.
原来的程序为:
&function dat2xls(varargin)
�T2XLS Copying (ASCII) data file (including headers
& column names) to Excel.
% dat2xls& :& This program reads
a (text data file) consisting of
%&&&&&&&&&&&&&&
headers, column titles and column data (see attached
%&&&&&&&&&&&&&&
data.txt).& Then it opens or creates existing
%&&&&&&&&&&&&&&
file and saves data into specified sheetname.
NOTE:&& The program will
automatically identify the number of
%&&&&&&&&&&
headerlines, columns and the column names using what so
%&&&&&&&&&&
"common sense"!
%& dat2xls(datfile,xlsfile,sheetname)
%& dat2xls(datfile,xlsfile)
datfile:&&&&&&&
Name of data file.
xlsfile:&&&&&&&
Name of excel file.
sheetname:&&&&&
sheet name (optional, default is 'Sheet1')
%&&&&&&&&&&&&&&&&&&&&&&
if specified, a sheet with the specified name must
%&&&&&&&&&&&&&&&&&&&&&&
be existing.
% Example:
datfile = 'data.txt';&
xlsfile = 'data.xls';
sheetname = 'Sheet2';
dat2xls(datfile,xlsfile,sheetname)
�t2xls(datfile,xlsfile)&&&&&&&&&&&&
% Will write to 'Sheet1'
%&& Copyright 2004 Fahad Al
%&& Version: 1.0
$& $Date: 18-Feb-2004
%&&&&&&&&&&&
1.5 $& $Date:&
3-Mar-2004&&&&&
% Fixed header bug + saving bug
See also XLSWRITE, XLSHEETS
if nargin==3
&&& datfile =
varargin{1};
&&& xlsfile =
varargin{2};
&&& sheetname =
varargin{3};
elseif nargin==2
&&& datfile =
varargin{1};
&&& xlsfile =
varargin{2};
&&& sheetname =
Excel = actxserver('Excel.Application');
%set(Excel, 'Visible', 1);
% Creating a new excel workbook or Opening (xlsfile)
if exist(xlsfile,'file')==0
following case if excel file does not exist (Creating New
&&& Workbook =
invoke(Excel.Workbooks,'Add');
&&& new=1;
following case if file does exist (Opening File)
disp(['Opening Excel File ...(' xlsfile ')']);
&&& Workbook =
invoke(Excel.Workbooks, 'open', [pwd filesep xlsfile]);
&&& new=0;
textread(datfile,'%s','delimiter','\n','emptyvalue',NaN);
for i=1:length(data)
~isempty(str2num(data{i}))
m(k,:) = str2num(data{i});
&&& elseif
~isempty(data{i})
header{i} = data{i};
% 遇到空行停下.
for ii=length(header):-1:1
~isempty(header{ii})
col_titles = header{ii};
% 将串col_titles中字符放到 数组colnames{c}中
rem = col_
while length(rem)~=0
[word,rem]=strtok(rem); %word为取rem第一个字符
~isspace(word)
colnames{c} =
for i=1:length(header)-1
H{i}=header{i};
header=[];
if exist('H')
&&& header =
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%& Modified copy of (xlswrite)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
[nr,nc] = size(m);
error('Matrix is too large.& Excel only supports
256 columns');
% Make the sheet active.
Sheets = Excel.ActiveWorkBook.S
target_sheet = get(Sheets, 'Item', sheetname);
invoke(target_sheet, 'Activate');
% Get a handle to the active sheet.
Activesheet = Excel.A
%Write header
if isempty(header)
&&& nhr=0;
elseif iscell(header)
length(header);&&&&&&
%Number header rows
ActivesheetRange = get(Activesheet,'Range',['A' num2str(ii)],['A'
num2str(ii)]);
set(ActivesheetRange, 'Value', header{ii});
1;&&&&&&&&&&&&&&&&&&&
%Number header rows
ActivesheetRange = get(Activesheet,'Range','A1','A1');
set(ActivesheetRange, 'Value', header);
�d column names
if ~isempty(colnames)
&&& nhr = nhr +
%One extra column name
&&& ncolnames =
length(colnames);
ii=1:ncolnames
colname = xlcolumn(ii);
cellname = [colname num2str(nhr)];
ActivesheetRange =
get(Activesheet,'Range',cellname,cellname);
set(ActivesheetRange, 'Value', colnames{ii});
% Put a MATLAB array into Excel.
FirstRow =
nhr+1;&&&&&&&&&&
%You can change the first data row here.& I start
right after the headers
LastRow = FirstRow+nr-1;
FirstCol =
'A';&&&&&&&&
%You can change the first column here
LastCol = localComputLastCol(FirstCol,nc);
ActivesheetRange = get(Activesheet,'Range',[FirstCol
num2str(FirstRow)],[LastCol num2str(LastRow)]);
set(ActivesheetRange, 'Value', m);
invoke(Workbook, 'SaveAs', [pwd filesep xlsfile]);
invoke(Workbook, 'Save');
invoke(Excel, 'Quit');
[pathstr,name,ext] = fileparts(xlsfile);
�lete the ActiveX object
delete(Excel)
function loc = xlcolumn(column)
if isnumeric(column)
column&256
error('Excel is limited to 256 columns! Enter an integer number
&&& letters =
{'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
&&& count =
column-26&=0
loc = char(letters(column));
while column-26&0
&&&&&&&&&&&
count = count + 1;
&&&&&&&&&&&
column = column - 26;
loc = [char(letters(count)) char(letters(column))];
&&& letters =
['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
size(column,2)==1
loc =findstr(column,letters);
&&& elseif
size(column,2)==2
loc1 =findstr(column(1),letters);
loc2 =findstr(column(2),letters);
loc = (26 + 26*loc1)-(26-loc2);
function LastCol = localComputLastCol(FirstCol,nc);
% Comput the name of the last column where we will place data
%& FirstCol& (string) name of
first column
total number of columns to write
%Excel's columns are named:
% A B C ... A AA AB AC AD .... BA BB BC ...
FirstColOffset = double(FirstCol) -
double('A');&&&
%Offset from column A
nc&=26-FirstColOffset&&&&&&
�sy if single letter
convert to ASCII code, add the number of needed columns, and
convert back
&&& LastCol =
char(double(FirstCol)+nc-1);
&&& % Fix for 52
or more columns.
ceil(nc/26);&&&&&&
%Number of groups (of 26)
rem(nc,26)+FirstColO&&&&&&&
%How many extra in this group beyond A
rem(nc,26)==0
LastColFirstLetter = char(double('A') + ng-2);
LastColSecondLetter = char(double('A') + rm-1);
&&& LastCol =
[LastColFirstLetter LastColSecondLetter];
修改后的运行情况如下:
text2excel('d:\data01.txt')
文件中的数据矩阵有30行,20列。
&恭喜! 数据已写入路径:“ d:\” 下的“ data01.xls”
里了,请及时查看!
text2excel('d:\data01.txt','mydate01.xls')
文件中的数据矩阵有30行,20列。
&恭喜! 数据已写入路径:“ d:\” 下的“ mydate01.xls”
里了,请及时查看!
text2excel('d:\data01.txt','e:\mydate01.xls')
文件中的数据矩阵有30行,20列。
&恭喜! 数据已写入路径:“ e:\” 下的“ mydate01.xls”
里了,请及时查看!
&& text2excel('data.txt')
文件中的数据矩阵有30行,20列。
&恭喜! 数据已写入路径:“ d:\MATLAB701\work\2007\自己编写的” 下的“
data.xls” 里了,请及时查看!
text2excel('data.txt','d:\date01.xls')
文件中的数据矩阵有30行,20列。
&恭喜! 数据已写入路径:“ d:\” 下的“ date01.xls”
里了,请及时查看!
text2excel('D:\mayi\ruanjian\data.txt')
文件中的数据矩阵有30行,20列。
&恭喜! 数据已写入路径:“ D:\mayi\ruanjian” 下的“ data.xls”
里了,请及时查看!
text2excel('D:\mayi\ruanjian\data.txt','ffffff.xls')
文件中的数据矩阵有30行,20列。
&恭喜! 数据已写入路径:“ D:\mayi\ruanjian” 下的“ ffffff.xls”
里了,请及时查看!
改编后的函数文件:
function text2excel(varargin)
% 由 dat2xls.m 改编 ,减少了几个bug,使之更完善.
% by SUCHENGGONG&
% CHONGQING UNIVERSITY
% text2excel Copying (ASCII) data file (including headers
& column names) to Excel.
% text2excel& : This program reads a (text data
file) consisting of
%&&&&&&&&&&&&&&
headers, column titles and column data (see attached
%&&&&&&&&&&&&&&
data.txt).& Then it opens or creates existing
%&&&&&&&&&&&&&&
file and saves data into specified sheetname.
NOTE:&& The program will
automatically identify the number of
%&&&&&&&&&&
headerlines, columns and the column names using what so
%&&&&&&&&&&
"common sense"!
% /txtfile 不指定路径默认为当前路径.xlsfil 不指定路径默认为与 txtfile路径相同.
%& text2excel(txtfile,xlsfile,sheetname)
%& /xlsfile
只指定名时放在txtfile同路径下,指定路径时放在指定的路径下.
%& text2excel(txtfile,xlsfile)
%& /xlsfile 放在与 txtfile 同名同路径下.
%& text2excel(txtfile)
txtfile:&&&&&&&
Name of data file.
xlsfile:&&&&&&&
Name of excel file.
sheetname:&&&&&
sheet name (optional, default is 'Sheet1')
%&&&&&&&&&&&&&&&&&&&&&&
if specified, a sheet with the specified name must
%&&&&&&&&&&&&&&&&&&&&&&
be existing.
% Example:
text2excel('d:\data.txt','e:\my.xls','Sheet2')
text2excel('d:\data.txt','my.xls') % 写'd:\data.txt'到
'd:\my.xls'的'Sheet1'.
text2excel('data.txt')&&&&&&&&&&&
% 写'd:\data.txt'到 'd:\data.xls'的'Sheet1'.
See also XLSWRITE, XLSHEETS&
% 检查输入变量.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if nargin==3
&&& datfile =
varargin{1};
&&& xlsfile =
varargin{2};
&&& sheetname =
varargin{3};
elseif nargin==2
&&& datfile =
varargin{1};
&&& xlsfile =
varargin{2};
&&& sheetname =
elseif nargin==1
&&& datfile =
varargin{1};
% datfile(length(fileparts(datfile))+2 : length(datfile))
可以去掉路径而只留其名.
&&& xlsfile =
[datfile(1:length(datfile)-3),'xls']; % 与datfile同名同路径.
&&& % xlsfile =
strrep(datfile,'.txt','.xls'); % 放在与datfile同名同路径,两者相同.
&&& sheetname =
error('请至少输入text文件名');
%------------------------------------------------------------------------
% 检查是否带了"txt"后缀.
tx_t=datfile(length(datfile)-2 : length(datfile));
if tx_t ~= 'txt'
&&& error('您在
text 的文件名后面没有带".txt"或有错误,请检查一下.')
%------------------------------------------------------------------------
% 查找 datfile 的路径.
if ~isempty(dir(fullfile(pwd,datfile)))
相对路径,即当前工作空间的路径.
&&& datfile =
fullfile(pwd,datfile);
elseif ~isempty(dir(datfile))
绝对路径,即指定的路径.
&&& datfile =
elseif ~isempty(which(datfile))
%& MATLAB 路径.
&&& datfile =
which(datfile);
&&& error('找不到
"%s".',datfile);
%------------------------------------------------------------------------
% 查找 xlsfile 的路径.
% xlsfile 只有名字如: 'name.xls'时,放在与datfile不同名同路径,或则放在指定的路径上.
if ~isempty(dir(fileparts(fullfile(pwd,xlsfile)))) % xlsfile
&&& path_ =
fileparts(datfile); len = length(path_);
&&& if len
&= 3 % 此举为无奈,当 xlsfile为根目录即如
'd:\date.txt'时,path_带有'\'否则不带.
xlsfile = [fileparts(datfile),xlsfile];& %
放在与datfile同路径不同名.
xlsfile = [fileparts(datfile),'\',xlsfile];& %
放在与datfile同路径不同名.
&&& % xlsfile
放在指定的路径上.
% 当前工作空间的路径为: xlsfile = fullfile(pwd,xlsfile); 这里没有用到.
%------------------------------------------------------------------------
% 检查excel是否有重名.
if ~isempty(dir(xlsfile))
&&& error('"%s"
已经存在,请更改要保存的excel表的名字.',xlsfile);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Excel = actxserver('Excel.Application');
%set(Excel, 'Visible', 1);
% Creating a new excel workbook or Opening (xlsfile)
if exist(xlsfile,'file')==0
following case if excel file does not exist (Creating New
&&& Workbook =
invoke(Excel.Workbooks,'Add');
&&& new=1;
following case if file does exist (Opening File)
disp(['Opening Excel File ...(' xlsfile ')']);
&&& Workbook =
invoke(Excel.Workbooks, 'open', [pwd filesep xlsfile]);
&&& new=0;
%------------------------------------------------------------------------
% 读text文件,把数据转化为字符放在 date 中.
textread(datfile,'%s','delimiter','\n','emptyvalue',NaN);
k=1; m=[];
for i=1:length(data)
~isempty(str2num(data{i}))
m(k,:) = str2num(data{i}); % 将数据放入 m 中.
&&& elseif
~isempty(data{i})
header{i} =
data{i};&&&&&&
% 将文字放入 header& 中.
%------------------------------------------------------------------------
% 遇到空行停下.
for ii=length(header):-1:1
~isempty(header{ii})
col_titles = header{ii};
%------------------------------------------------------------------------
% 将串 col_titles 中字符放到 数组colnames{c}中
rem = col_
while length(rem)~=0
[word,rem]=strtok(rem); %word为取rem第一个字符
~isspace(word)
colnames{c} =
%------------------------------------------------------------------------
% 将 header 中字符放到 数组 H 中.
for i=1:length(header)-1
H{i}=header{i};
if exist('H')
&&& header =
header=[];
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%& Modified copy of (xlswrite)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
if ~isempty(m) % 检验数据是否存在.
[nr,nc] = size(m);
chenggong=['&&&&
文件中的数据矩阵有',num2str(nr),'行,',num2str(nc), '列。'];
disp(chenggong);
error('Matrix is too large.& Excel only supports
256 columns');
% Make the sheet active.
Sheets = Excel.ActiveWorkBook.S
target_sheet = get(Sheets, 'Item', sheetname);
invoke(target_sheet, 'Activate');
% Get a handle to the active sheet.
Activesheet = Excel.A
%Write header
if isempty(header)
&&& nhr=0;
elseif iscell(header)
length(header);&&&&&&
%Number header rows
ActivesheetRange = get(Activesheet,'Range',['A' num2str(ii)],['A'
num2str(ii)]);
set(ActivesheetRange, 'Value', header{ii});
1;&&&&&&&&&&&&&&&&&&&
%Number header rows
ActivesheetRange = get(Activesheet,'Range','A1','A1');
set(ActivesheetRange, 'Value', header);
�d column names
if ~isempty(colnames)
&&& nhr = nhr +
%One extra column name
&&& ncolnames =
length(colnames);
ii=1:ncolnames
colname = xlcolumn(ii);
cellname = [colname num2str(nhr)];
ActivesheetRange =
get(Activesheet,'Range',cellname,cellname);
set(ActivesheetRange, 'Value', colnames{ii});
% Put a MATLAB array into Excel.
if ~isempty(m)& % 检验数据是否存在.
FirstRow =
nhr+1;&&&&&&&&&&
%You can change the first data row here.& I start
right after the headers
LastRow = FirstRow+nr-1;
FirstCol =
'A';&&&&&&&&
%You can change the first column here
LastCol = localComputLastCol(FirstCol,nc);
ActivesheetRange = get(Activesheet,'Range',[FirstCol
num2str(FirstRow)],[LastCol num2str(LastRow)]);
set(ActivesheetRange, 'Value', m);
invoke(Workbook, 'SaveAs', xlsfile);
invoke(Workbook, 'Save');
invoke(Excel, 'Quit');
[pathstr,name,ext] = fileparts(xlsfile);
�lete the ActiveX object
delete(Excel)
path_ = fileparts(xlsfile);
len = length(path_);
if len &= 3
&&& len = len +
1; % 此举为无奈,当 xlsfile为根目录即 'd:\date.txt'时,path_带有'\'
&&& len = len +
name_ = xlsfile(len : length(xlsfile));
su=[' 恭喜! 数据已写入路径:“ ',path_,'” 下的“ ',name_,'” 里了,请及时查看!'];
-----------------subfunction-------------------------------------------
function loc = xlcolumn(column)
if isnumeric(column)
column&256
error('Excel is limited to 256 columns! Enter an integer number
&&& letters =
{'A','B','C','D','E','F','G','H','I','J','K','L'...
&&&&&&&&&&&&&&
,'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
&&& count =
column-26&=0
loc = char(letters(column));
while column-26&0
&&&&&&&&&&&
count = count + 1;
&&&&&&&&&&&
column = column - 26;
loc = [char(letters(count)) char(letters(column))];
&&& letters =
['A','B','C','D','E','F','G','H','I','J','K','L',...
&&&&&&&&&&&&&&
'M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'];
size(column,2)==1
loc =findstr(column,letters);
&&& elseif
size(column,2)==2
loc1 =findstr(column(1),letters);
loc2 =findstr(column(2),letters);
loc = (26 + 26*loc1)-(26-loc2);
-----------------subfunction-------------------------------------------
function LastCol = localComputLastCol(FirstCol,nc);
% Comput the name of the last column where we will place data
%& FirstCol& (string) name of
first column
total number of columns to write
%Excel's columns are named:
% A B C ... A AA AB AC AD .... BA BB BC ...
FirstColOffset = double(FirstCol) -
double('A');&&&
%Offset from column A
nc&=26-FirstColOffset&&&&&&
�sy if single letter
convert to ASCII code, add the number of needed columns, and
convert back
&&& LastCol =
char(double(FirstCol)+nc-1);
&&& % Fix for 52
or more columns.
ceil(nc/26);&&&&&&
%Number of groups (of 26)
rem(nc,26)+FirstColO&&&&&&&
%How many extra in this group beyond A
rem(nc,26)==0
LastColFirstLetter = char(double('A') + ng-2);
LastColSecondLetter = char(double('A') + rm-1);
&&& LastCol =
[LastColFirstLetter LastColSecondLetter];
已投稿到:
以上网友发言只代表其个人观点,不代表新浪网的观点或立场。查看: 806|回复: 1|关注: 0
将excel表中的数据进行分组怎么实现,求指导
数据一共4列,分别代表空间坐标x,y,z和时间t,想要将数据按照x、y均为定值的条件,进行数据分组。分组前,数据存储为二维矩阵,分组后,数据存储为三维矩阵,编了一个程序,但是有些错误,数据和程序都放在附件,希望高手能够指导一下,指出错误所在,帮忙改一下!谢谢!
a=xlsread('ym1');%处理数据A(单位:cm)
nubx=15;nuby=15;nubz=12; %输入坐标轴的刻度个数
A=sortxy(a,nubx,nuby,nubz);%数据分组。矩阵A每一页x,y是定值,得到t-z散点图
%P是提取数据后的结果存放矩阵,三维的。每页小矩阵是x,y值相等的一条线上的点
%P定义时每维按最大的数。每页的点最多有nubz个,4列存点的三坐标和时间t
P(nubz,4,nubx*nuby)=0;%预定义存放结果的矩阵
%预定义结束
%将实验记录数据a分组为三维数组,每页中的x,y是定值,z与t是变量
a1=a(:,1); %以x为定值分组
for x=-7:1:7
a2=find(a1==x*2.5);%find函数是找到满足条件的元素的列标。
[i,j]=ind2sub(size(a),a2);
b=a(a3,:);%x为某一值的所有行标
%以上四句的作用是找到x为某定值的所有行
b1=b(:,2);%以y为定值分组
& & for y=-7:1:7
& & b2=find(b1==y*2.5);%从b1中找到等于y*2.5的数
& & [i,j]=ind2sub(size(b1),b2);
& & c=b(b3,:);%得到x,y均为定值的行标
& & %以上四句的作用是在x为某定值的情况下,再检索出y为某定值的所有行
& & row=size(c);
& & P(1:row(1),:,g)=c;%将检索出的x,y都为定值的数据存入矩阵P中
& & %P矩阵为包括全0阵和单行阵的所有小矩阵
& & g=g+1;%P矩阵自动翻页,每页存的数据x,y都为定值
%剔除0行阵和单行阵,即本程序只保存到两行及多行阵
%根据每行的第一列进行区分。第一列为0,则意味着该行是0行
for r=1:(nubx*nuby)
p1=P(:,:,r);
& &if max(find(p1(:,1)~=0))&2%提取各页非0行大于2行的矩阵
& && &A(:,:,ra)=P(:,:,r);%将满足条件的矩阵存入A
& && &ra=ra+1;
& &elseif max(find(p1(:,1)~=0))==2%提取各页非0行等于2行的矩阵
& && && && && && && && && && && & %继续存入A
A(:,:,ra)=P(:,:,r);%从P中提取出的二行阵和多行阵
format short g%转化A的存储格式。从指数形式转为浮点数形式
%名词解释:
%全0行——某行的值都为0;
%0行阵:整个矩阵都是0;
%单行阵:矩阵只有1行不是全0行。
%两行阵:非全0行的数目为2
%多行阵:非全0行的数目大于2
%剔除数据结束
22:04 上传
点击文件名下载附件
1.76 KB, 下载次数: 0
22:04 上传
点击文件名下载附件
40.35 KB, 下载次数: 0
解决了吗= =
站长推荐 /1
Powered by苹果/安卓/wp
苹果/安卓/wp
积分 877, 距离下一级还需 498 积分
权限: 自定义头衔, 签名中使用图片, 隐身
道具: 彩虹炫, 雷达卡, 热点灯, 雷鸣之声, 涂鸦板, 金钱卡, 显身卡, 匿名卡, 抢沙发下一级可获得
权限: 设置帖子权限道具: 提升卡
购买后可立即获得
权限: 隐身
道具: 金钱卡, 雷鸣之声, 彩虹炫, 雷达卡, 涂鸦板, 热点灯
悲催签到天数: 1 天连续签到: 1 天[LV.1]初来乍到
如题,请教各位。看了几本参考书都没有相关的内容。另外,我以前向版主请教过一个函数,关于求随机样本尾指数的,现在又忘了,请各位指教,谢谢。
载入中......
卒然临之而不惊,无故加之而不怒
打开Matlab后,使用open打开你要的文件的文件夹,在下拉框中显示所有文件,然后选中你要的EXCEL文件就好了。如果EXCEL有几张工作表的话,可能会出错,应该保留一个工作表就可以,也不必重命名了,命名有大小写之分。
我试了一下,数据过不去,提示如下:Error using ==& sprintfFunction 'sprintf' is not defined for values of class 'cell'.文件只有一个工作表。我以前见过将EXCEL和MATLAB联接都一起的方法,可惜现在都忘了。请指教
卒然临之而不惊,无故加之而不怒
help xlsread还可以考虑exlink
谢谢斑竹和网友panp,我已经打开了,给大家也介绍一下:将EXCEL文件保存为CSV(逗号分割符)格式,同时删除表头,只留下矩阵(否则只能打开第一行)就可以直接打开了。缺省的变量名为A_____1,自己再改名就可以了。版主介绍的exlink我以前用过,也可以,但没有这种方法方便。关于tail(就是求尾指数的)的函数谁知道,帮帮兄弟。
卒然临之而不惊,无故加之而不怒
将EXCEL文件另存为.CSV格式(逗号分割符)的,然后用dlmread命令进行读取就OK了。
我是直接用C#读取excel,组合成matlab能够识别的文本进行计算的,走了偏门
xlsread('*******')
********你的EXCEL表格
论坛好贴推荐
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
&nbsp&nbsp|
为做大做强论坛,本站接受风险投资商咨询,请联系(010-)
邮箱:service@pinggu.org
合作咨询电话:(010)
广告合作电话:(刘老师)
投诉电话:(010)
不良信息处理电话:(010)
京ICP证090565号
京公网安备号
论坛法律顾问:王进律师第三方登录:}

我要回帖

更多关于 matlab读入excel 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信