How to grab message from command window and take action in code depending on it.
1 回表示 (過去 30 日間)
古いコメントを表示
How to check command window output and performe action depending on it.
for k = 1:500;
z=z+1;
check(z); %% check.p file checking z and gives output in command window
%% code that should breake the code if command window throws "z is correct"
end
2 件のコメント
採用された回答
Image Analyst
2019 年 10 月 8 日
I'm almost certain you do not want to do what you asked. It's bizarre. Why not just write a normal program with a GUI or an inputdlg() to ask the user for some input? Or if it was something printed/echoed to the command window by a line of code in your program, just send that line directly to whatever other code needs it.
6 件のコメント
Image Analyst
2019 年 10 月 12 日
Open the diary file and search for the stopping condition with strfind() or endsWith(). If you find it, turn the diary off. Then since no diary will be continued I guess you'll have to determine somehow in your code when to start logging output to the diary again.
その他の回答 (1 件)
参考
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!