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

相关推荐
diemeng111925 分钟前
2024系统编程语言风云变幻:Rust持续领跑,Zig与Ada异军突起
开发语言·前端·后端·rust
软件黑马王子39 分钟前
Unity游戏制作中的C#基础(3)加减乘除算术操作符,比较运算符,逻辑与,或运算符
开发语言·unity·c#
张太行_40 分钟前
Qt Creator 设计界面后的预览方法
开发语言·qt
视觉CG44 分钟前
【Viewer.js】vue3封装图片查看器
开发语言·javascript·vue.js
h^hh1 小时前
洛谷 P3405 [USACO16DEC] Cities and States S(详解)c++
开发语言·数据结构·c++·算法·哈希算法
qwy7152292581631 小时前
20-R 绘图 - 饼图
开发语言·数据库·r语言
重生之我要成为代码大佬1 小时前
Python天梯赛10分题-念数字、求整数段和、比较大小、计算阶乘和
开发语言·数据结构·python·算法
琑951 小时前
nextjs项目搭建——头部导航
开发语言·前端·javascript
酷爱码2 小时前
2025 PHP授权系统网站源码
开发语言·php
张胤尘2 小时前
Lua | 每日一练 (3)
开发语言·面试·lua