Matlab won't run script file.

5 次查看(过去 30 天)
Anna
Anna 2013-8-4
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 个评论
Cedric
Cedric 2013-8-4
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?

请先登录,再进行评论。

回答(1 个)

Jan
Jan 2013-8-4
编辑:Jan 2013-8-4
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.

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by