필터 지우기
필터 지우기

startup.m problem

조회 수: 8 (최근 30일)
Oliver
Oliver 2011년 8월 4일
편집: Jeffrey Chiou 2014년 6월 25일
In my startup.m file I install a toolbox each time matlab is loaded (because I store the toolbox in my Dropbox folder since I frequently change files in it and want access to the updated version from both computers that I use, however, if someone has a better idea I would love a more elegant solution). Here is the startup.m code:
addpath(genpath('C:\Users\Oliver\Dropbox\MATLAB'))
cd('C:\Users\Oliver\Dropbox\MIT\Jan2011 to Sep2011\Matlab Files')
%---install mtex toolbox---%
cd('C:\Users\Oliver\Dropbox\mtex-3.1')
startup_mtex;
%---change back to original directory---%
cd('C:\Users\Oliver\Dropbox\MIT\Jan2011 to Sep2011\Matlab Files')
With Matlab R2010b when Matlab started I would get the following message:
--------------------------------------------------------------------------------
MTEX is currently not installed.
Do you want to permanently install MTEX? Y/N [Y]
I would then type "y" and the toolbox would be installed. However, when I upgraded to R2011a I have a problem. When matlab starts I just get a blinking cursor and in the lower left hand corner the status says "waiting for input". If I type "y" then the message pops up and it installs alright. But why would Matlab switch the order of displaying the prompt and waiting for its input?
Incidentally, the first two times I opened Matlab after upgrading the prompt came up first and then it waited for my input, but after the first two times it switched and has stayed this way. Any ideas?
Thank you!
-Oliver

답변 (2개)

Oliver Woodford
Oliver Woodford 2011년 8월 10일
Since you call startup_mtex from your startup file it adds mtex to the MATLAB path on startup. You therefore don't need to add it to the saved path, and can simply comment out line 27 of startup_mtex.m:
install_mtex(local_path);
thus getting rid of the issue. Incidentally, I prefer to add things to the path in my startup file (as you are doing) rather than add them to the permanent path because when I upgrade MATLAB I don't need to add them to the saved path all over again.
  댓글 수: 2
Alex
Alex 2013년 11월 7일
편집: Alex 2013년 11월 7일
Unfortunately I have the same problem and can not use suggested solution
We have historical startup.m file, which asks user on what kind of software he wants to choose during startup (conflicting software) e.g.
ch=input('type a if you want to use a and anything else if b','s')
if strncmpi(ch,'a',1)
... initialize a
else
... initialize b
end
Everything was working fine in (some) earlier versions of Matlab, but 2013a and 2013b just sits on blinking cursor. you have to guess and type something -- then it goes further.
Does anybody know how to deal with this annoying issue?
Samuel Quemby
Samuel Quemby 2014년 4월 1일
Hi,
I'm having (almost exactly) the same problem as Alex, above. Did you manage to find a solution?
Sam.

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


Jeffrey Chiou
Jeffrey Chiou 2014년 6월 25일
편집: Jeffrey Chiou 2014년 6월 25일
Hi Oliver,
In a nutshell, edit this line in the block that calls startup in matlabrc.m:
if ismcc || ~isdeployed
to this:
if ~(ismcc || isdeployed)
Edit: If it still doesn't work, try adding
while ismcc, end
or
if ~ismcc
in startup.m

카테고리

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