Hi,
I am receiving an error while trying to save a file. I have entered:
A=[34,45;17,6]
save A1.dat A -ascii
I am receiving
??? Error using ==> save
Unable to write file A1.dat: permission denied.
I just installed MATLAB and do not know how to grant myself permission to write the files.

답변 (4개)

Andreas Goser
Andreas Goser 2012년 1월 10일

1 개 추천

There is no need to enable saving or so. This will be just related to the directory / folder you attempt writing to. Mostly, this is when you have a directory within yout MATLAB installation. Try a different directory. If difficulties persist, let us know the OS, the MATLAB release and the directory name.

댓글 수: 4

Jared
Jared 2012년 1월 10일
I have been able to save the .dat file as a .m file in a seperate folder from the editor. When I run the code, I get my matrix as coded, followed by that error. But I need to be able to save the code as denoted for my class in order to submit my code for assignments. OS Window's 7
Jared
Jared 2012년 1월 10일
MATLAB 7.12.0(R2011a) I am not sure what you mean by directory name. I am new to MATLAB and using it for a class.
Andreas Goser
Andreas Goser 2012년 1월 12일
"directory name" is with relation to the operating system. In MATLAB, you get the "current directory", e.g. by using the PWD command, or you see it at the top of the IDE. If yoo copy that string into the Windows Explorer, then you can check permissions. If it is below the MATLAB installation path, you should chosse a different directory for saving data.
Tushant Verma
Tushant Verma 2021년 10월 21일
Thanks Andreas ,this worked for me

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

Sven Schoeberichts
Sven Schoeberichts 2012년 1월 12일

0 개 추천

Sounds like you're using a school's computer, and appearently you lack the permission to write to the MATLAB directory.
Try saving to a USB memory stick, or the My Documents folder.
Getinet Amare
Getinet Amare 2017년 12월 20일
편집: Walter Roberson 2017년 12월 20일

0 개 추천

use this command with file name getinet.mat
save(fullfile(tempdir, 'getinet.mat'))
and to load a file with file name getinet.mat
load(fullfile(tempdir, 'getinet.mat'))
have a nice coding with great day

댓글 수: 1

Walter Roberson
Walter Roberson 2017년 12월 20일
Be careful, though: if you are using a shared computer, then the systems administrator might delete the contents of the temporary directory at any time. Also, some operating systems delete the temporary directory files each time the system reboots.

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

karim botros
karim botros 2023년 10월 2일

0 개 추천

In Windows,
1) you need to open matlab as administrator, if you are admin.
2) create the folder and check if the path fully exists.

카테고리

도움말 센터File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

질문:

2012년 1월 10일

답변:

2023년 10월 2일

Community Treasure Hunt

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

Start Hunting!

Translated by