Azzera filtri
Azzera filtri

Matlab won't run script file.

5 visualizzazioni (ultimi 30 giorni)
Anna
Anna il 4 Ago 2013
Matlab was working fine until today.
I tried to run a script file and matlab won't even attempt to run it. I know its not that matlab can't find the file because it works exactly 4 times then doesn't any longer. When I press the green run button, F5 or just type the file name matlab does absolutely nothing.
I have tried restarting the program (matlab runs the script 4 times then it just doesn't work), restarting my laptop and went as far as to reinstall the software. This hasn't worked.I am running on windows.
I have noticed its exactly 4 times after restarting the program.
  1 Commento
Cedric
Cedric il 4 Ago 2013
When you say "doesn't run any longer", does it mean that MATLAB freezes or that just nothing happens? If there is no freeze, can you type commands in the command window, or run other scripts?

Accedi per commentare.

Risposte (1)

Jan
Jan il 4 Ago 2013
Modificato: Jan il 4 Ago 2013
How do you check, that "Matlab does nothing"? Did you set a breakpoint in the first line of the script and stepped through the code?
If the problem is, that you do not see anything, the behavior can easily reproduced by this script:
UD = get(0, 'UserData')
if isempty(UD)
UD = 1;
else
UD = UD + 1;
end
if UD > 4
return;
end
fprintf('Number of runs: %d\n', UD);
set(0, 'UserData', UD);
This looks also, like it runs 4 times only. But could this be useful to solve your problem?! No, a reliable analysis of your problem requires seeing the relevant part of your code which reproduces the effects you see.

Categorie

Scopri di più su Get Started with MATLAB in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by