필터 지우기
필터 지우기

When I run a simulation I get error "Cannot CD to C:\Users\S​RINIV~1\Ap​pData\Loca​l\Temp (Name is nonexistent or not a directory) ". I searched in web and I tried teh following,

조회 수: 5 (최근 30일)
>> restoredefaultpath
>> savepath
Error using cd
Cannot CD to C:\Users\SRINIV~1\AppData\Local\Temp (Name is nonexistent or not a
directory).
Error in tempdir (line 31)
curr_dir = cd(tmp_dir);
Error in tempname (line 18)
dirname = tempdir;
Error in savepath>iFopenTempLocation (line 265)
name = tempname;
Error in savepath (line 149)
[ fid tempfilename ] = iFopenTempLocation( );
  댓글 수: 1
Kaustubha Govind
Kaustubha Govind 2013년 4월 8일
편집: Kaustubha Govind 2013년 4월 8일
Looks like the path set in your System TEMP environment variable doesn't exist. Can you fix it to a folder that does exist, restart MATLAB and try again? Make sure that "getenv TEMP" in MATLAB returns a path that exists.

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

답변 (3개)

Saurabh Kataria
Saurabh Kataria 2014년 7월 1일
I got the following error (while is quite similar to yours) while using a function file save2pdf.m:
Error using cd Cannot CD to C:\Users\SAURAB~1\AppData\Local\Temp (Name is nonexistent or not a directory).
I think this has to do with administrative rights. Try running MATLAB in administrative mode and the problem shall vanish.
P.S. It worked for my case.

Image Analyst
Image Analyst 2013년 4월 7일
What does it say if you enter path after restoredefaultpath and before savepath?
  댓글 수: 2
Srinivasan Pradabane
Srinivasan Pradabane 2013년 4월 8일
After "restoredefaultpath" it says nothing, as u can seen in the question I have posted. I am sick about this and please help me out...
Image Analyst
Image Analyst 2013년 4월 8일
That's not what I asked. I asked what does path say. Put these lines in your code
clc; % Clear command window
restoredefaultpath
path % print path environment variable to command window
getenv TEMP % Kaustubha's suggestion
What is in your command window after those lines execute? savepath

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


jozef jozefi
jozef jozefi 2016년 7월 12일
temp file in the C DIRECTORY of the path must be given full access control by right clicking the folder. and going to security and give full access, any of them will work .
for run temp file win key +R= Run %temp%

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by