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

1 Ansicht (letzte 30 Tage)
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

Akzeptierte Antwort

Fangjun Jiang
Fangjun Jiang am 5 Sep. 2011
data=magic(5);
file=fullfile(pathstr,'r.xls');
if exist(file,'file')
file=fullfile(pathstr,'Modified.xls');
end
xlswrite(file,data);
  10 Kommentare
Fangjun Jiang
Fangjun Jiang am 5 Sep. 2011
It's probably complaining the whitespace between 'yyyy' and 'HH'.
mohammad
mohammad am 5 Sep. 2011
thanks a lot, great!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu File Operations finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by