I hope you don’t find it weird that I’m advertising -nodesktop mode on the Desktop blog. Don’t worry, I won’t take it personally if you decide to use this startup option. -nodesktop behaves differently depending if you are on Windows vs Linux or Mac. On Windows we provide a boring Command-Window only interface that lacks the “bells and whistles” of the regular Command Window or the full Desktop. I’m too biased to offer an opinion, but some of our users have reported they find this mode aesthetically pleasing. FYI, we recommend starting the MATLAB Desktop with the Command Window only layout instead of the -nodesktop route, Desktop -> Desktop Layout -> Command Window Only; using -nodesktop on Windows is not officially supported.
In the -nodesktop mode, you still have full access to figure windows, and you can bring up pieces of the desktop with commands like edit and commandhistory. You can launch the full desktop with the command desktop, but doing this puts control with the regular command window, and you’re left with a non-functioning -nodesktop command window window. When you bring up the Desktop in this manner, closing the Desktop window will return control to the original command window; it does not exit MATLAB.
Do not confuse this option with -nojvm option, which not only does not load the desktop, but does not load java. That means you can’t later bring up the desktop, (in the future) launch figure windows, or use any commands that use java libraries, like some of the network and file i/o functions. We don’t recommend using this option.
There’s also a -nosplash option for starting MATLAB, but this just skips the splash screen (the first window with the picture of the membrane and the version number). It still loads into the desktop.
Comments are closed.
20 CommentsOldest to Newest
x = 0:0.1:2*pi(); y = sin( x ); plot(x,y); %print -dpng test.png; saveas( gcf(), 'test.fig', 'fig' ); saveas( gcf(), 'test.png', 'png' ); exit;And I call this script through a batch file called test.bat:
start matlab -nosplash -nodesktop -minimize -r testThen, I can get a test.png file showing my plot as well as a copy of the data as plotted for later investigation. (As an aside, I checked and, yes, the print command and saveas produce equivalent png images.) In the process, however, the command window is brought up (minimized, thanks to the built-in Windows 'start' command) and the figure window flashes. Are there any command-line switches that prevent this from happening? It seems that on *NIX environments, one can simply set the DISPLAY environment to a null value and achieve this result, but I cannot find a way to do it in Windows... Can you offer any advice here? Thanks!
matlab -nodesktop -r myfunction,quit. If it's later case where you need an interactive mode, there are some rather non-trivial options, and you can contact me to discuss them offline.