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

相关推荐
爱写代码的刚子2 分钟前
C++知识总结
java·开发语言·c++
martian6652 分钟前
QT开发:基于Qt实现的交通信号灯模拟器:实现一个带有倒计时功能的图形界面应用
开发语言·qt
冷琴19969 分钟前
基于java+springboot的酒店预定网站、酒店客房管理系统
java·开发语言·spring boot
缘友一世17 分钟前
macOS .bash_profile配置文件优化记录
开发语言·macos·bash
tekin20 分钟前
macos 中使用macport安装,配置,切换多版本php,使用port 安装php扩展方法总结
开发语言·macos·php·port·mac多版本php安装管理·port-select
CSXB9929 分钟前
一、Python(介绍、环境搭建)
开发语言·python·测试工具·集成测试
火红的小辣椒39 分钟前
PHP反序列化7(字符串逃逸)
开发语言·web安全·php
三玖诶1 小时前
第一弹:C++ 的基本知识概述
开发语言·c++
wjs20241 小时前
Chrome 浏览器:现代网络浏览的先锋
开发语言
爱学的小涛1 小时前
【NIO基础】基于 NIO 中的组件实现对文件的操作(文件编程),FileChannel 详解
java·开发语言·笔记·后端·nio