How can I stop/halt script (1) , get prompt and execute script(2), once done return to script(1)?
2 views (last 30 days)
Show older comments
I am looking to have "Press to Continue" button , while the control is at the Command Window prompt.
I could simply set the " keyboard " ,and once done set "return".
Example:
%=================================
for i=1:20; % Perform the following statements 20 times
disp( ' M ' );
keyboard; % Press "return" from prompt
end
%=====================================
When I halt/pause the "for loop " execution by " keyboard " command, I run a bunch of additional code or m.file script , my primer script using SOC to control equipment, etc....need to stay in last operation. Once done ( run script (2)) I would like to toggle a button to continue , basically to perform " return" function , callback of this button .
%=====================================
figH = figure;
uicontrol('Style', 'pushbutton', 'Callback', '????????(????)'); % ????????
for i=1:20; % Perform the following statements 20 times
disp( ' M ' );
% insted of ==>keyboard;
drawnow; % %
xxxxxx(figH); % % Halt and Set the prompt command window
% Click Button =[send "return" ] ,insted of
% typing in the prompt
end
%===============================================
0 Comments
Answers (1)
Walter Roberson
on 14 Jan 2013
Try adding a
return
command in your script. (Note: I would not expect this to work if it was a function you were running instead of a script.)
0 Comments
See Also
Categories
Find more on Desktop in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!