- use uiwait() or waitfor() to wait for the figure to be destroyed
- use pause() with no time (just pause by itself) to have MATLAB wait until a key is pressed -- but the key would have to be pressed in the command window and you do not want there to be a command window
- use the Automation Interface to talk to MATLAB from a different program
- In a different program use a .NET call to start MATLAB; you can send commands to the MATLAB session, eventually telling it to quit. Or just use .NET to start the process because you want to be able to kill the process easily
Can I run matlab's command windows in win10's cmd???
5 views (last 30 days)
Show older comments
Kevin Chen
on 11 Oct 2020
Commented: Kevin Chen
on 11 Oct 2020
I am running a matlab file using -batch command on windows cmd.
At first, I type this on cmd
matlab -nosplash -nodesktop -minimize -r file_name
and I don't want matlab's command windows to show.
Then I type this
matlab -batch file_name
but the plot suddenly disappear.And i also try this
matlab -batch "file_name; pause( sec )"
but it only exsist for only a few seconds.
Is there any solution that I can directly get into matlab's command windows like this vedio
, or without losing my plot after I run command???( in win10 2020b)
0 Comments
Accepted Answer
Walter Roberson
on 11 Oct 2020
The plot is going to disappear as soon as the MATLAB process exists. To keep the plot around indefinitely, you need to keep MATLAB from exiting.
Some ways you can do that include:
More Answers (0)
See Also
Categories
Find more on Call MATLAB from .NET 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!