2014-04-20 22:08:11

在命令行下执行:

matlab -help

可以得到帮助文件:

Usage:  matlab [-h|-help] | [-n | -e]
[-arch | v=variant | v=arch/variant]
[-c licensefile] [-display Xdisplay | -nodisplay]
[-nosplash] [-mwvisual visualid] [-debug] [-softwareopengl]
[-desktop | -nodesktop | -nojvm]
[-r MATLAB_command] [-logfile log]
[-Ddebugger [options]] -h|-help - Display arguments.
-n - Display final environment variables,
arguments, and other diagnostic
information. MATLAB is not run.
-e - Display ALL the environment variables and
their values to standard output. MATLAB
is not run. If the exit status is not
on return then the variables and values
may not be correct.
-arch - Start MATLAB assuming architecture arch.
v=variant - Start the version of MATLAB found
in bin/glnxa64/variant instead of bin/glnxa64.
v=arch/variant - Start the version of MATLAB found
in bin/arch/variant instead of bin/glnxa64.
-c licensefile - Set location of the license file that MATLAB
should use. It can have the form port@host or
be a colon separated list of license files.
The LM_LICENSE_FILE and MLM_LICENSE_FILE
environment variables will be ignored.
-display Xdisplay - Send X commands to X server display, Xdisplay.
-nodisplay - Do not display any X commands. The MATLAB
desktop will not be started. However, unless
-nojvm is also provided the Java virtual machine
will be started.
-nosplash - Do not display the splash screen during startup.
-mwvisual visualid - The default X visual to use for figure windows.
-debug - Provide debugging information especially for X
based problems.
-desktop - Allow the MATLAB desktop to be started by a
process without a controlling terminal. This is
usually a required command line argument when
attempting to start MATLAB from a window manager
menu or desktop icon.
-nodesktop - Do not start the MATLAB desktop. Use the current
terminal 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.
-jdb [port] - Enable remote Java debugging on port (default )
-r MATLAB_command - Start MATLAB and execute the MATLAB_command.
-logfile log - Make a copy of any output to the command window
in file log. This includes all crash reports.
-Ddebugger [options] - Start debugger to debug MATLAB.
-nouserjavapath - Ignore custom javaclasspath.txt and javalibrarypath.txt files.

可以看到与图形界面相关的几个参数是:nodisplay, nosplash, nodesktop, nojvm. 它们分别代表什么含义呢?

  1. nodisplay      不显示任何X命令(X server是Linux下的图形引擎,参考:X Window System)。Matlab桌面环境不会启动,但是会启动Java virtual machine除非使用了nojvm参数;
  2. nosplash   程序启动时不显示启动画面(版权页);
  3. nodesktop  不启动桌面环境,在当前终端中执行命令,但是会启动JVM;
  4. nojvm      关闭java支持,不启动JVM,特别的,desktop也不会启动。

因为Matlab的图形环境依赖JVM,如果不启动JVM,无法执行任何和图形界面相关的命令。若不执行任何X commands,则无法执行imshow()这些函数。所以,我们如果需要在命令行下执行matlab程序,最好只添加:nodesktop nosplash两个参数。

可以在文件.bashrc中添加:

alias mrun="matlab -nodesktop -nosplash -logfile `date +%Y_%m_%d-%H_%M_%S`.log -r"

其中,logfile `date +%Y_%m_%d-%H_%M_%S`.log 将log文件输出在了以程序执行时间为文件名的log文件下。r 参数表示运行matlab命令。

在命令行下运行Matlab的更多相关文章

  1. 命令行下运行php的方法和技巧

    linux中直接用"php"命令来执行php文件 一般在linux命令行下运行php文件的代码: XML/HTML代码 linux下执行:#php安装路径 -f php文件路径 例 ...

  2. 命令行下运行 java someClass.class出现 “错误:找不到或无法加载主类someClass ” 的解决方案

    假设在C:\Java\code\目录下建立了如下 Test.java文件: package code; public class Test { public static void main(Stri ...

  3. 如何在CLI命令行下运行PHP脚本,同时向PHP脚本传递参数?

    <?php/* //命令行输入输出流fwrite(STDOUT,"Enter your name:"); $name = trim(fgets(STDOUT)); fwrit ...

  4. 如何在命令行下运行kettle的作业(job)和转换(transform)

    pan 是执行转换的. Pan.bat /file C:\test.ktr /logfile c:\log.txt /level Basic kitchen是执行job的. kitchen.bat / ...

  5. 命令行下的“蒙面歌王”rundll32.exe

    在Windows系统中,为了节省内存和实现代码重用,微软在Windows操作系统中实现了一种共享函数库的方式.这就是DLL(Dynamic Link Library)文件,即动态链接库,这种库包含了可 ...

  6. [兴趣使然]用python在命令行下画jandan像素超载鸡

    下午刷煎蛋的时候看到 Dthalo 蛋友发的系列像素超载鸡,就想自己试试用python脚本画一个,老男孩视频里的作业真没兴趣,弄不好吧没意思,往好了写,自己控制不好,能力不够. 所以还是找自己有兴趣的 ...

  7. Matlab命令行编译运行HelloWorld

    Matlab安装完成后用记事本写一个文件HelloWorld.m内容如下: function HelloWorld() disp('Hello,World!'); end 保存后在命令行中切到Hell ...

  8. Windows下使用MinGW在命令行编译运行C++程序

    之前学习C语言的时候都是用IDE类似CodeBlocks的工具写完直接编译运行的,今天突然心血来潮,自己下一个编译器,在命令行下,编译运行C++程序,了解一下编译过程. 一.安装编译器 首先你需要下载 ...

  9. .Net Core IIS下无Log4Net日志输出,命令行下却有(dotnet运行)

    .Net Core IIS下无Log4Net日志输出,命令行下却有(dotnet运行) 遇到个诡异的问题,项目发布并寄宿到 IIS上后,Log4Net没有日志输出 1.原因分析 这不应该啊,所有的配置 ...

随机推荐

  1. BZOJ-1085 骑士精神

    估价函数其实就是与目标状态有几个不同... 迭代启发搜索. #include <cstdlib> #include <cstdio> #include <cstring& ...

  2. BZOJ4598 [Sdoi2016]模式字符串 【点分治 + hash】

    题目 给出n个结点的树结构T,其中每一个结点上有一个字符,这里我们所说的字符只考虑大写字母A到Z,再给出长度为m 的模式串s,其中每一位仍然是A到z的大写字母.Alice希望知道,有多少对结点< ...

  3. windows下 maven+selenium+testng项目搭建(七)

    Selenium2.47.1 + Maven3.3.9 + TestNG6.8.8 windows准备好以下环境 1. Jdk,环境变量配置 2. maven环境3. eclipse 开发工具 ,ec ...

  4. SharepPoint 2013安装体会

    SharePoint 2013出来了,一直没有找到合适的机器来安装.前天腾出来一台内存8G的机器,决定在Hyper-V上安装在一台虚机,然后装个Windows 2012,再装SharePoint 20 ...

  5. 【CF1025A】Doggo Recoloring(签到)

    题意:给定一个长度为 n 的小写字母串.可以将出现次数大于等于2的字母全部变成另一个小写字母,问最后能否将该小写字母串的所有字母变成同一个字母 n<=1e5 思路: #include<cs ...

  6. java mail Received fatal alert: handshake_failure java 无法发送邮件问题 java 发送qq邮件(含源码)

     java 无法发送邮件问题 java 发送qq邮件 报错:java mail Received fatal alert: handshake_failure (使用ssl) javax.mail.M ...

  7. Swoole RPC 的实现

    目录 概述 实现效果 代码 小结 概述 这是关于 Swoole 学习的第七篇文章:Swoole RPC 的实现. 第六篇:Swoole 整合成一个小框架 第五篇:Swoole 多协议 多端口 的应用 ...

  8. git移除上一次的commit中误添加的文件

    在使用git进行版本管理时,往往会出现一些误操作,比如将一些不加上传的文件放到了暂存区,即上传到了上一次commit中 比如: commit c134ab90ca7c4daf8bfa22e3ad706 ...

  9. 【java】RC4加密转16进制获取长度为40的不重复优惠码字符串 【未优化版本】

    需求:需要一串给各机构独有的优惠码 间接需求:固定长度.不重复.没有规律可循 实现思想如下: 1.首先获取一个UUID 2.去除UUID中的“-” 3.小写转大写 4.获取一个固定长度字符串 5.按照 ...

  10. Android View 布局流程(Layout)完全解析

    前言 上一篇文章,笔者详细讲述了View三大工作流程的第一个,Measure流程,如果对测量流程还不熟悉的读者可以参考一下上一篇文章.测量流程主要是对View树进行测量,获取每一个View的测量宽高, ...