How to save to mat file

조회 수: 11 (최근 30일)
Carol
Carol 2013년 8월 27일
댓글: Walter Roberson 2017년 12월 20일
Hi All,
I am having some problem now and need to solve it urgently. Please help.
imep=W4/(pi*b^2/4*s);
eta=W4/mass1*(1+phi*0.06548*(1-f))/phi/0.06548/(1-f)/47870/1e3;
timefinish=cputime;
timetaken=timefinish-timestart;
% save all data
save ahrind.mat
clear
I am having some error.
*Error using save Unable to write file ahrind.mat: permission denied.
Error in ahrind (line 80) save ahrind.mat *
Can I know how can I save the file to mat format.
Thanks.

채택된 답변

Iain
Iain 2013년 8월 27일
Looks like you're trying to save a file to either, an open file (try "fclose all"), or a file location that you do not have permission to write to.
If someone else has the file open, "fclose all" will do nothing. If you don't have write access, you need to talk to your admin. - But you should be able to save it somewhere only you can see, like:
save 'D:\my document folder\matlab stuff\test.mat'
  댓글 수: 2
Carol
Carol 2013년 8월 27일
It works 10 years ago.:)
this works.
I am curious why I cant save it directly.
I saved the files in my dekstop folder and created the path accordingly.
Image Analyst
Image Analyst 2013년 8월 27일
What is the "current folder"? If it's something under c:\program files and you're using Windows7, you won't be able to do that.

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

추가 답변 (3개)

the cyclist
the cyclist 2013년 8월 27일
Just a guess, but this seems to be a system problem, not a MATLAB problem.
It seems you do not have write permission in the directory where you are running this code.
  댓글 수: 1
Ashish Rawat
Ashish Rawat 2017년 9월 30일
How can i get the permission?

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


Jan
Jan 2013년 8월 27일
The message means, that you do not have write permissions in the current folder. So either obtain these permissions (perhaps by asking your admin), or write the data to another folder:
save(fullfile(tempdir, 'ahrind.mat'))

Getinet Amare
Getinet Amare 2017년 12월 20일
The message means, that you do not have write permissions in the current folder. So either obtain these permissions (perhaps by asking your admin), or write the data to another folder:
save(fullfile(tempdir, 'getinet.mat')) to load the file you saved you can use the following command i.e. simply change the save command to load and leave the rest as it is load(fullfile(tempdir,'getinet.mat'))
  댓글 수: 1
Walter Roberson
Walter Roberson 2017년 12월 20일
Systems administrators might delete temporary directories without notice. Also, some operating systems delete temporary directories upon every reboot. Some "system performance enhancing" software delete the temporary files as well.

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

카테고리

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