How can I stop/halt script (1) , get prompt and execute script(2), once done return to script(1)?
조회 수: 2 (최근 30일)
이전 댓글 표시
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
답변 (1개)
Walter Roberson
2013년 1월 14일
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
참고 항목
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!