Can not run a script

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 comentarios

Birdman
Birdman el 13 de Dic. de 2017
Is there any infinite loop or buggy code in your GUI?
Henan
Henan el 13 de Dic. de 2017
No loop There is same case in other script.Attachment is my GUI.
Jan
Jan el 14 de Dic. de 2017
Editada: Jan el 14 de Dic. de 2017
What happens if you start the code by typing the calling sequence in the command window? Birdman asked, if the editor shows warning or errors of the code: Do you see and red marks on the right side?
Henan
Henan el 15 de Dic. de 2017
1.I open the script and click the run button,there is no warning or errors in command windows. 2.No red marks on the right sight. 3.if I typing the calling sequence in the command window, all going well
Image Analyst
Image Analyst el 15 de Dic. de 2017
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.
Henan
Henan el 16 de Dic. de 2017
I run green triangle in the text editor, ye, I am sure not double click the .fig to run.

Iniciar sesión para comentar.

Respuestas (2)

Image Analyst
Image Analyst el 15 de Dic. de 2017
Editada: Image Analyst el 15 de Dic. de 2017

0 votos

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 comentarios

Henan
Henan el 16 de Dic. de 2017
Status bar no busy mode, command window is normal.
Image Analyst
Image Analyst el 16 de Dic. de 2017
Look at the last line of your push button callback:
delete(gcf)
Exactly what do you think that will do? It will blow away your GUI. The Run button is back to a Run button. It does not turn into the grayed out Pause button. I know - I just tried it. The delete(gcf) will totally shut it down and return MATLAB to the initial condition before you even ran your GUI. If you don't want that to happen, get rid of the delete() function call.
Henan
Henan el 17 de Dic. de 2017
delete(gcf): I just want to close the figure automatically;
I have reinstall my MATLAB, the same script run so far so good.
I doubt if my MATLAB have some error? I don't know, I will continuous concern this incident. All in all, Thank you for your help and support.@Image Analyst @Jan Simon
Image Analyst
Image Analyst el 17 de Dic. de 2017
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.

Iniciar sesión para comentar.

Jan
Jan el 15 de Dic. de 2017

0 votos

'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 comentarios

Henan
Henan el 17 de Dic. de 2017
ok, its my spelling mistake,but it is not the reason why RUN button is paused.
Jan
Jan el 17 de Dic. de 2017
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
Jan el 17 de Dic. de 2017
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.

Iniciar sesión para comentar.

Categorías

Más información sobre Environment and Settings en Centro de ayuda y File Exchange.

Productos

Etiquetas

Preguntada:

el 13 de Dic. de 2017

Comentada:

Jan
el 17 de Dic. de 2017

Community Treasure Hunt

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

Start Hunting!

Translated by