1788_通过CMD命令行启动操作MATLAB

全部学习汇总: GitHub - GreyZhang/g_matlab: MATLAB once used to be my daily tool. After many years when I go back and read my old learning notes I felt maybe I still need it in the future. So, start this repo to keep some of my old learning notes servral years ago.

工作需要通过CMD启动MATLAB并对其进行部分操作,一通试探找出了MATLAB作为命令的参数,具体的参数表如下:

matlab [-? ^| -h ^| -help]

-c licensefile

-nosplash

-nodesktop \^\| -nojvm

-win32

-r MATLAB_command

-logfile log

-wait

-noFigureWindows

-automation\] \[-regserver\] \[-unregserver

-?^|-h^|-help - Display arguments. Do not start MATLAB.

-c licensefile - Set location of the license file that MATLAB

should use. It can have the form port@host.

The LM_LICENSE_FILE and MLM_LICENSE_FILE

environment variables will be ignored.

-nosplash - Do not display the splash screen during startup.

-nodesktop - Do not start the MATLAB desktop. Use V5 MATLAB

command window for commands. The Java virtual

machine will be started.

-singleCompThread - Limit MATLAB to a single computational thread.

By default, MATLAB makes use of the multithreading

capabilities of the computer on which it is running.

-nojvm - Shut off all Java support by not starting the

Java virtual machine. In particular the MATLAB

desktop will not be started.

-win32 - forces matlab to run in win32 mode even on 64 bit

processors.

-r MATLAB_command - Start MATLAB and execute the MATLAB_command.

Any "M" file must be on the MATLAB path.

-logfile log - Make a copy of any output to the command window

in file log. This includes all crash reports.

-wait - MATLAB is started by a separate starter program

which normally launches MATLAB and then immediately

quits. Using the -wait option tells the starter

program not to quit until MATLAB has terminated.

This option is useful when you need to process the

the results from MATLAB in a script. The call to

MATLAB with this option will block the script from

continuing until the results are generated.

-noFigureWindows - Never display a figure window

-automation - Start MATLAB as an automation server,

minimized and without the MATLAB splash screen.

-jdb [port] - Enable remote Java debugging on port (default 4444)

-regserver - Register MATLAB as a COM server

-unregserver - Remove MATLAB COM server registry entries.

-sd startup directory- Allows specification of the MATLAB startup

directory. The token $documents can be used

to reference the Windows "Documents" folder

-shield level - Win32 only: Protects integrity of address space to

ensure large contiguous free memory for array data

level - minimum (default)

protects 5000000h-7000000h address range

until before matlabrc.m is processed

  • none (safest) no protection is applied

The following are experimental and may be changed

or removed:

  • medium (aggressive) protects

5000000h-7000000h address range

until after matlabrc.m is processed

  • maximum (very aggressive) calculated

range held until after matlabrc.m is

processed

-shieldload <list> - Win32 only: (experimental) loads dlls identified in

comma separated list

Version: 8.3.0,539

先抛开我想要做的东西,简单来看一下上面这些参数的作用,我挑选部分我觉得我可能有用或者感兴趣的列数自己的理解如下:

1,-?^|-h^|-help

这个参数是我找到这一推参数的根由。这是查找帮助时候的参数,使用的时候MATLAB并不会启动。

2,-c licensefile

指定启动时候的license,如果跟环境变量的冲突,以这个为准。

3,-nosplash

如果加了这个参数,MATLAB启动时候停留在桌面几秒钟的那个图形界面将不再显示。

4,-nodesktop

这个参数可以不以桌面环境的形式启动MATLAB,但是还是没有百分百摆脱GUI。我曾经看过一眼ETAS的HIL软件平台,其实ETAS选择的就是这种方式。

5,-singleCompThread

默认情况下MATLAB会使用多线程,但是如果使用这个命令参数的话就会强制MATLAB使用单一的线程。

6,-nojvm

禁用JAVA虚拟机。

7,-win32

即使是64位处理器也以win32的模式跑(为什么不直接在64位系统上安装一个32位版本?)

8,-r MATLAB_command

执行MATLAB的命令或者M文件,M文件的话必须在MATLAB的path中。这个值得一说,因为我在这上面反复碰壁最终才找到了一个好歹能够对付的解决方案。

9,-logfile log

记录命令输出窗口的记录以及所有的命令,最后如果出错似乎也记录。

10,-wait

介绍中说这个很有用,尤其是启动了一个进程而后面的程序又需要这个进程的结果时。对目前的我来说,可能还过于高级,暂时用不上。

11,-noFigureWindows

我没有弄明白这个跟4有什么差异。

12,-sd startup directory

这个我觉得很有用,可以启动MATLAB的时候自动切换到指定的目录。

剩下的几个关于服务器、JAVA以及操作系统的,超出了我的知识范畴,暂时不做探索。

相关推荐
梦境虽美,却不长13 分钟前
C语言 学习 文件操作(开关,读写,定位,大小)操作 2025年6月8日12:19:24
c语言·开发语言·学习
Charlotte_jc21 分钟前
完美解决openpyxl保存Excel丢失图像/形状资源的技术方案
开发语言·python·excel·openpyxl
西北大程序猿41 分钟前
服务器代码知识点补充
服务器·开发语言·网络·c++·网络协议
新知图书2 小时前
R语言ICU患者死亡率预测实战
开发语言·r语言
wennieFan3 小时前
python基础面试练习题
开发语言·python
阿福不是狗3 小时前
Python使用总结之Linux部署python3环境
linux·开发语言·python
枣伊吕波3 小时前
第十三节:第七部分:Stream流的中间方法、Stream流的终结方法
java·开发语言
一点也不想取名3 小时前
解决 Java 与 JavaScript 之间特殊字符传递问题的终极方案
java·开发语言·javascript
im_AMBER4 小时前
java复习 11
java·开发语言
Cai junhao4 小时前
【Qt】工具介绍和信号与槽机制
开发语言·c++·qt·qt6.3