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以及操作系统的,超出了我的知识范畴,暂时不做探索。

相关推荐
q567315231 分钟前
R语言初学者爬虫简单模板
开发语言·爬虫·r语言·iphone
rzl021 小时前
java web5(黑马)
java·开发语言·前端
时序数据说1 小时前
为什么时序数据库IoTDB选择Java作为开发语言
java·大数据·开发语言·数据库·物联网·时序数据库·iotdb
jingling5551 小时前
面试版-前端开发核心知识
开发语言·前端·javascript·vue.js·面试·前端框架
m0_687399841 小时前
写一个Ununtu C++ 程序,调用ffmpeg API, 来判断一个数字电影的视频文件mxf 是不是Jpeg2000?
开发语言·c++·ffmpeg
爱上语文1 小时前
Redis基础(5):Redis的Java客户端
java·开发语言·数据库·redis·后端
A~taoker2 小时前
taoker的项目维护(ng服务器)
java·开发语言
萧曵 丶2 小时前
Rust 中的返回类型
开发语言·后端·rust
hi星尘2 小时前
深度解析:Java内部类与外部类的交互机制
java·开发语言·交互
看到我,请让我去学习2 小时前
Qt编程-qml操作(js,c++,canvas)
开发语言·qt