meatball1982 发表于 2016-8-20 10:27:55

豆粑粑 matlab 文字命令 text mode

转的
https://linuxinfo.physik.hu-berlin.de/matlab.html




From the command line:

matlabgraphical interface
matlab -nodesktop -nosplashtext mode, with graphics window
matlab -nodisplaytext mode, without graphics
(if /usr/global/matlab/bin is in PATH).


Running Matlab from scriptsIn order to run Matlab code from a script, prepare a file with extension .m and run it with the switch "-r".
Examples:      matlab -rmyscript         # run myscript.m      matlab -r "myfct(2,3)"      # run myfct.m with argumentsIn non-interactive mode (e.g. from a batch script), you may have to extend PATH and set MATLABPATH first. In addition, the graphical interface and plot window are to be suppressed.
Example:      PATH=/usr/global/matlab/bin:$PATH      MATLABPATH=$HOME/my_matlab_dir      export MATLABPATH      matlab -nodisplay -r "myscript, quit"   # run myscript.m and quitThe trailing "quit" makes sure that Matlab is terminated, even if this was omitted from the script.
Plots are generated as usual, but will not be displayed. The most recent one can be stored as a file by a Matlab statement like      saveas(gcf,'filename.ext')          % format according to extension      saveas(gcf,'filename.eps','psc2')   % EPS with colorValid extensions are .fig (Matlab's format), .eps, .jpg, .png and others (but no PDF).

页: [1]
查看完整版本: 豆粑粑 matlab 文字命令 text mode