xlswrite not saving too an Excel file

2 ビュー (過去 30 日間)
Robert Roy
Robert Roy 2016 年 6 月 1 日
コメント済み: Robert Roy 2016 年 6 月 2 日
Hi guys, Iam having problem saving my results from a code as an excel file, it does comes up as an unregistered 02 file that cant be opened by excel though I am wondering if anyone has had similar problems?
  5 件のコメント
Robert Roy
Robert Roy 2016 年 6 月 1 日
Apologies, Its a Windows 8, It has previously worked before the code to produce excel files but now it just produces this 02 file which i dont know what it is. Microsoft Office is installed
Image Analyst
Image Analyst 2016 年 6 月 1 日
What do you mean by it "comes up as an unregistered 02 file"? Where does it "come up" as that? In MATLAB, in Excel, in File Explorer? What is an 02 file? What is the filename? Did you not give it an extension of .xlsx?

サインインしてコメントする。

採用された回答

Walter Roberson
Walter Roberson 2016 年 6 月 1 日
I speculate that the filename you are passing to xlswrite ends in '.02' and that you are expecting xlswrite to add on a .xls or .xlsx extension to that. xlswrite() only automatically adds on extensions if there are no '.' in the file portion of the name (that is, excluding any directory)
  1 件のコメント
Robert Roy
Robert Roy 2016 年 6 月 2 日
That seems to work thanks very much

サインインしてコメントする。

その他の回答 (1 件)

Robert Roy
Robert Roy 2016 年 6 月 1 日
編集済み: Robert Roy 2016 年 6 月 1 日
x2=[((-x1/2)):(Res):(x1/2)];
Res=0.004
y2=1
x=5
for j=j1:j2;
for j=l1:l2;
Cr1=[x_start y_start+(l*(y2/Res)) x/Res y2/Res];
Cr = imcrop(YourData, Cr1);
Tresult(:,j)=mean(Cr).';
end
end
start_cell = 'D1'; % starting cell
Sheet = 1; % sheet number
Sheet3=3;
skip_col = 1; % number of empty columns between entries
% transform into cell and insert empty columns
Nrows = size(Tresult,1);
Ncols = size(Tresult,2);
Tresult_cell = cell(Nrows,(1+skip_col)*Ncols);
Tresult_cell(:,1:(1+skip_col):end) = num2cell(Tresult);
% write file
xlswrite(filename,Tresult_cell,Sheet,start_cell);
start='B:B';
[status,message]=xlswrite(filename,stdErr,Sheet3,start);
xlswrite(filename,x2.',Sheet3,start);

カテゴリ

Help Center および File ExchangeSpreadsheets についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by