i want save the table in file on my computer , i wrote the following but display error ? what should i do ?

save Table3; fname='newfile.xlsx'; xlswrite(fname,Table3);
Error using save Unable to write file Table3: permission denied.
Error in two (line 261) save Table3;

답변 (2개)

You do not have write permissions in the current folder. This is solved by specifiying a valid folder:
folder = tempdir;
fname = fullfile(folder, 'newfile.xlsx');
save(fname, 'Table3');

댓글 수: 4

ok, but where the place where the file (contain table) is stored?
You can find it by running this:
file_location = which('newfile.xlsx')
i wrote folder = tempdir; fname = fullfile(folder, 'newfile.xlsx'); save(fname, 'Table3'); file_location = which('newfile.xlsx') and the file that contains the table does not appear after
@mohammed: The file is saved in the folder, which is defined by the tempdir command. Type this in the command window:
tempdir
Of course you can use any otehr folder also, but I could not guess which folder you want. Therefore I've chosen tempdir as example:
folder = 'C:\Data\YourFolder\xyz;
fname = fullfile(folder, 'newfile.xlsx');
save(fname, 'Table3');
You can use uigetfolder also to select a folder in a GUI, or the output of userpath.

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

Also, if you mean "table" as in the data type whose class is table, don't use xlswrite, use writetable.

카테고리

도움말 센터File Exchange에서 MATLAB Report Generator에 대해 자세히 알아보기

태그

아직 태그를 입력하지 않았습니다.

질문:

2017년 1월 30일

댓글:

Jan
2017년 1월 31일

Community Treasure Hunt

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

Start Hunting!

Translated by