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

相关推荐
律品5 分钟前
pytest的前置与后置
开发语言·python·pytest
山中月侣1 小时前
Java多线程编程——基础篇
java·开发语言·经验分享·笔记·学习方法
励志不掉头发的内向程序员2 小时前
STL库——string(类模拟实现)
开发语言·c++
王廷胡_白嫖帝2 小时前
Qt文件压缩工具项目开发教程
java·开发语言·qt
张飞洪2 小时前
C# 13 与 .NET 9 跨平台开发实战:基于.NET 9 与 EF Core 9 的现代网站与服务开发
开发语言·c#·.net
郝学胜-神的一滴2 小时前
使用C++11改进工厂方法模式:支持运行时配置的增强实现
开发语言·c++·程序人生·设计模式
我是场2 小时前
Android14内核调试 - boot & vendor_boot
java·开发语言·spring boot
爱和冰阔落2 小时前
从关机小游戏学 C 语言:分支循环 + 关键字(break/continue)实战
c语言·开发语言
Korloa3 小时前
表达式(CSP-J 2021-Expr)题目详解
c语言·开发语言·数据结构·c++·算法·蓝桥杯·个人开发
yodala3 小时前
C++中的内存管理(二)
开发语言·c++