将matlab求出的矩阵保存在Excel表格中
转贴Genial分享程序
function xlswrite(m,header,colnames,filename);
%
xlswrite Easily create an Excel spreadsheet from MATLAB
%
% xlswrite(m,header,colnames,filename) creates a
Microsoft Excel
% spreadsheet using
% the MATLAB ActiveX interface. Microsoft Excel is required.
%
%Inputs:
% m Matrix to write to file
% (Optional):
% header String of header information.
% Use cell array for multiple lines
% DO NOT USE multiple row character arrays!!
% colnames (Cell array of
strings) Column headers.
% One cell element per column
% filename (string) Name of Excel
file. If not specified, contents will
% be opened in Excel.
%
% ex:
% m = rand(100,4);
% header = 'my data';
% %header{1} = 'first
line'; %This will give
% %header{2} = 'second
line'; % 2 header lines
% colnames =
{'Ch1','Ch2','Ch3','Ch4'};
%
% xlswrite(m,header,colnames,'myfile.xls');
% will save t