Can not run a script
조회 수: 10 (최근 30일)
이전 댓글 표시
I have a very simple GUI script, after I have run a few times, the run button become a 'gray pause' and the script can not be run again.

There is no error info in command window.
댓글 수: 6
Image Analyst
2017년 12월 15일
Can you also attach the .fig file so we can actually RUN this code?
By the way, how are you running this code? You're clicking on the green run triangle either in GUIDE or in the text editor, right? You're NOT double clicking the .fig file in the "Current folder" panel, are you? That won't work.
답변 (2개)
Image Analyst
2017년 12월 15일
편집: Image Analyst
2017년 12월 15일
Does the status bar in the lower left of the MATLAB window say "Busy"?
Try clicking in the command window and typing control-c a few times.
댓글 수: 4
Image Analyst
2017년 12월 17일
Well then it does that. It runs and closes itself down. I do not see the problem of the pause button showing. You'll have to call tech support because I can't reproduce your issue.
Jan
2017년 12월 15일
'Enable','of'
This should cause an error message, because the value must be 'on' or 'off'. After this error, the GUI might stop to work. But I do not see, why the Run button is disabled then.
댓글 수: 3
Jan
2017년 12월 17일
A bold guess: Matlab is usually stable, but as an interpreted language it is susceptible for shadowing built-in functions. When the user redefines a toolbox function, the complete system can melt down. I have created a modified strcmp, which crashed. Afterwards I could neither open the file in the editor nor run rmpath or pathtool to remove this function, even closing Matlab did not work.
So check if you have shadowed an important built-in function: https://www.mathworks.com/matlabcentral/fileexchange/27861-uniquefuncnames . Never add user-defined folders on top of the path, but always at the bottom, to avoid this problem. Do not set the working directory to one of the toolbox folders, because this affects the precedence of functions.
But as usual for guessing: There is no evidence this this cause the problems you are faced with.
Jan
2017년 12월 17일
This spelling mistake should let the code stop with an error message actually. You should have seen this when you try to run the code.
A bold guess: Matlab is usually stable, but as an interpreted language it is susceptible for shadowing built-in functions. When the user redefines a toolbox function, the complete system can melt down. I have created a modified strcmp, which crashed. Afterwards I could neither open the file in the editor nor run rmpath or pathtool to remove this function, even closing Matlab did not work.
So check if you have shadowed an important built-in function: https://www.mathworks.com/matlabcentral/fileexchange/27861-uniquefuncnames . Never add user-defined folders on top of the path, but always at the bottom, to avoid this problem. Do not set the working directory to one of the toolbox folders, because this affects the precedence of functions.
But as usual for guessing: There is no evidence this this cause the problems you are faced with.
참고 항목
카테고리
Help Center 및 File Exchange에서 Environment and Settings에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!