Run a script in GUI.

1 view (last 30 days)
Jaehoon
Jaehoon on 29 May 2014
Commented: Geoff Hayes on 29 May 2014
Hi, I have a question about running a script from GUI.
I have a RUN button in GUI that runs a script called 'filename'
function btn_RUN_Callback(hObject, eventdata, handles)
x = 3;
run('filename')
and the script 'filename' is just
pause(x)
fprint(x)
Here is my question. When the script is run normally(separately), '>>' in the command window disappears for 'x' seconds and reappears when it is done. However, when I run the script from GUI by clicking RUN button, '>>' never disappears at 'pause(x)' stage and keep showing in the command windows. Why does this happen? Is there any way that I can run the script like it normally runs?
Thanks in advance.
  1 Comment
Geoff Hayes
Geoff Hayes on 29 May 2014
The code of the script is running from the context of the GUI and not from the command window so this behaviour is expected. Why would you want to observe the disappearance of the cursor when the button in the GUI is pressed?

Sign in to comment.

Answers (0)

Categories

Find more on Interactive Control and Callbacks in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!