startup.m problem
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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
0 commentaires
Réponses (2)
Oliver Woodford
le 10 Août 2011
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 commentaires
Alex
le 7 Nov 2013
Modifié(e) : Alex
le 7 Nov 2013
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
le 1 Avr 2014
Hi,
I'm having (almost exactly) the same problem as Alex, above. Did you manage to find a solution?
Sam.
Jeffrey Chiou
le 25 Juin 2014
Modifié(e) : Jeffrey Chiou
le 25 Juin 2014
Hi Oliver,
See my response here for full details http://www.mathworks.com/matlabcentral/answers/105256#answer_142450 (in response to a similar question)
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
0 commentaires
Voir également
Catégories
En savoir plus sur Startup and Shutdown dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!