Save .xls in certain folder

3 ビュー (過去 30 日間)
Jorge Pascual
Jorge Pascual 2020 年 1 月 11 日
回答済み: dpb 2020 年 1 月 11 日
Hi everyone!
I am trying to save a variable (app.Pedobarography_Values) in a determiante path, but as .xls document.
First I convert the .mat file to .xls, then I select the path with 'uigetdir', and finally I am trying to save it, but nothing happens
Anyone knows the reason?
XLSPBG=xlswrite('Pedobarography_Values.xslx',app.Pedobarography_Values);
selpath = uigetdir
save(selpath,'XLSPBG');

回答 (1 件)

dpb
dpb 2020 年 1 月 11 日
You saved the variable app.Pedobarography_Values in the file 'Pedobarography_Values.xslx' but by the documentation for xlswrite (which is, by the way, deprecated; use writetable or writematrix instead) the return value is simply the status of the write operation...1--> success, 0--> failure. So, the most you have done with the SAVE operation is write a single logical value to the location from the returned path into file named the result of evaluation of the string [selpath '.mat']. More than likely this is an invalid location.
At a minimum, use something like
selpath = uigetdir;
writematrix(app.Pedobarography_Values,fullfile(selpath,'Pedobarography_Values.xslx'));

カテゴリ

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