convert a cell to .xls file and save it in a specified folder

조회 수: 1 (최근 30일)
mohammad
mohammad 2011년 9월 5일
does anyone know how to convert a matrix to .xls file and save it in a specified folder?
for example:
% r is a cell and path is certain
if ~exist(path\r.xls)=7
make r.xls
else
make r.Date Modified.xls in path % Date Modified can obtain by dir()
end

채택된 답변

Fangjun Jiang
Fangjun Jiang 2011년 9월 5일
data=magic(5);
file=fullfile(pathstr,'r.xls');
if exist(file,'file')
file=fullfile(pathstr,'Modified.xls');
end
xlswrite(file,data);
  댓글 수: 10
Fangjun Jiang
Fangjun Jiang 2011년 9월 5일
It's probably complaining the whitespace between 'yyyy' and 'HH'.
mohammad
mohammad 2011년 9월 5일
thanks a lot, great!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 File Operations에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by