필터 지우기
필터 지우기

startup.m file sequence

조회 수: 1 (최근 30일)
Seetha Rama Raju Sanapala
Seetha Rama Raju Sanapala 2014년 4월 11일
댓글: Seetha Rama Raju Sanapala 2014년 7월 27일
My startup file is as below
cd ('C:\Documents and Settings\Seetha Rama Raju S\Desktop\Dr. Seetha Rama Raju Sanapala\Not directly connected\ssrr\MATLAB') diary xxx Whoareyou=input('Identify yourself\n', 's');
As such I expect once MATLAB is invoked, Iexpect MATLAB to chage the directory first to the above, then start the diary and ask to identify.
But I noticed that till the user enters the answer to the prompt the directory is not changed. Without executing the first line ( change directory) how is it coming to the line of prompt.
Best regards, Seetha Rama Raju Sanapala
  댓글 수: 2
Andreas Goser
Andreas Goser 2014년 4월 11일
Are your sure? Can you execute "pwd" or "cd" right after changing?
Seetha Rama Raju Sanapala
Seetha Rama Raju Sanapala 2014년 7월 27일
You are right. If I do pwd or cd it is showing that it is changing immediately. But when you look at the current folder space in MATLAB window it is updated only after I enter the answer to the prompt. Good check you suggested. Is there a way I can accept your comment as answer. Also, what could be the reason the current folder is not updated. immediately after the change.

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

답변 (1개)

Jeffrey Chiou
Jeffrey Chiou 2014년 6월 25일
편집: Jeffrey Chiou 2014년 6월 25일
Hi Seetha,
I believe this happens because, in recent versions of MATLAB, startup.m runs during the compilation process. See my response here for full details http://www.mathworks.com/matlabcentral/answers/105256#answer_142450 (in response to a similar question)
To summarize, edit this line in the block that calls startup in matlabrc.m:
if ismcc || ~isdeployed
to this:
if ~(ismcc || isdeployed)
Note: I am not sure if this will cause any adverse effects. Editing matlabrc.m is discouraged.
Edit: If it still doesn't work, try adding
while ismcc, end
or
if ~ismcc
in startup.m
  댓글 수: 1
Seetha Rama Raju Sanapala
Seetha Rama Raju Sanapala 2014년 7월 27일
Thank you very much Jeffrey Chow! Your answer "compilation" is a bit technical for me. I will let you know after I make the changes you suggested.

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

카테고리

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