How can I stop/halt script (1) , get prompt and execute script(2), once done return to script(1)?

2 Ansichten (letzte 30 Tage)
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
%===============================================

Antworten (1)

Walter Roberson
Walter Roberson am 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.)

Kategorien

Mehr zu Desktop finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by