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 CenterFile Exchange에서 Spreadsheets에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by