在Linux下安装完matlab后,会在/usr/local/bin/下生成matlab文件,可以使用matlab命令。

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
                                            0 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 4444)
    -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.

在命令行下运行matlab,主要用到上面几个红色的参数。

1.直接运行Matlab

$ matlab

然后可以直接运行matlab脚本

2.运行m文件

如果m文件名为matlabfile.m

(1)方法一

进入m文件所在目录后,运行

$ matlab -nodesktop -nosplash -rmatlabfile

只用文件名matlabfile,不能添加.m

(2)修改.bashrc文件

$ vim ~/.bashrc

添加如下:

# Add an "mrun" alias for running matlab in the terminal.
alias mrun="matlab -nodesktop -nosplash -logfile `date +%Y_%m_%d-%H_%M_%S`.log -r"

保存后,进入.m文件所在目录,运行

$ mrun matlabfile

转载于:https://www.cnblogs.com/lixuebin/p/10814888.html

在Linux命令行下运行Matlab相关推荐

  1. Ubuntu命令行下运行matlab

    1. 打开matlab 无窗口命令 sudo /usr/local/MATLAB/R2013a/bin/matlab -nodisplay 2. 运行命令 run test 备注: test.m是需要 ...

  2. 网页版天气预报linux,在Linux 命令行下浏览天气预报

    在Linux 下安装 wego 安装 wego 相当简单.wego 是用 Go 编写的,引起第一个步骤就是安装Go 语言.然后再安装 wego. $ go get github.com/schachm ...

  3. linux怎么进mysql天气_在Linux 命令行下浏览天气预报

    导读 Q: 我经常在 Linux 桌面查看天气预报.然而,是否有一种在终端环境下,不通过桌面小插件或者浏览器查询天气预报的方法?其中有一个就是wego,一个终端下的小巧程序.使用基于ncurses 的 ...

  4. Linux 命令行下的好东西

    Linux 命令行下的好东西 本文转载自简书http://www.jianshu.com/p/5ca890e5bdbf 现在做网站做移动应用最讲究的就是推广了,推广做的好那就成功了一大半,相对的没曝光 ...

  5. linux命令行下的BT软件(转)

    linux命令行下的BT软件(转) 我家里的所有机器都是通过一台slackware 10.1作网关来上网的.最近很想玩魔兽世界,就开始在这台slackware 10.1下的vmware gsx ser ...

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

    命令行下运行 java someClass.class出现 "错误:找不到或无法加载主类someClass " 的解决方案 参考文章: (1)命令行下运行 java someCla ...

  7. linux命令行下命令参数前的一横(-)和两横(--)的区别

    linux命令行下命令参数前的一横(-)和两横(--)的区别 原文转自:http://blog.csdn.net/songjinshi/article/details/6816776 在解释这些区别之 ...

  8. ffmpeg linux 命令,Linux命令行下转换媒体格式工具FFMPEG介绍

    Linux命令行下转换媒体格式工具FFMPEG介绍 格式:ffmpeg [[输入文件选项]- i 输入文件名] {[输入文件选项] 输出文件名} 主要选项: -L 显示ffmpeg的版权说明 -h 显 ...

  9. linux命令行下载github文件,Linux命令行下使用GitHub

    Linux命令行下使用GitHub 1.注册github账号 2.创建ssh密钥 cd ~ ssh-keygen -t rsa -C your_email@example.com 1 2 cd~ ss ...

最新文章

  1. Vue 中 CSS 动画原理
  2. Oracle针对SCOTT下EMP表的练习题
  3. python读取txt文件写入-python 读取、写入txt文件的示例
  4. 【知识星球】重要小结与涨价预告
  5. p,br,hn,b,i,u,s,sup,sub标签
  6. linux go redis,go-redis 连接池
  7. “压倒性快感”是怎么来的?氪金抽卡,是利用认知BUG的最强发明
  8. LeetCode 24. 两两交换链表中的节点(递归+循环)
  9. (转) 淘淘商城系列——Redis集群的搭建
  10. 为什么JS中0.1+0.2 != 0.3
  11. HG221GS光猫超级密码破解(烽火,华为)
  12. 手机用计算机怎么求最高分,计算机中求最高分怎么算【excel 如何去掉一个最高分和一个最低分求平均数】...
  13. sudo su与su的区别
  14. windows 下搭建git服务器,及问题处理。
  15. qq离线linux,QQ For Linux 我哭了,官方版
  16. 社工2014年春晚名人小彩旗(魏彩绮)
  17. EventLoopGroupEventLoop
  18. 视频时序动作识别(video action recognition)介绍
  19. openssl version mismatch. built against 30000010, you have 30100000
  20. 萌新小白萌新中软实习day7

热门文章

  1. c++ -- 构造函数与析构函数
  2. 【EF Code First】 一对一、一对多的多重关系配置
  3. Extjs4.0 开发笔记-desktop开始菜单动态生成方法
  4. 算法学习:最小圆覆盖
  5. git的简单使用(一些小操作,持续更新)
  6. bzoj1816: [Cqoi2010]扑克牌
  7. 【平台兼容性】jeecg3.7 兼容weblogic 部署改造方案
  8. 软件项目开发计划书【申明:来源于网络】
  9. iOS.访问通讯录.02.写入联系人
  10. Ubuntu的防火墙配置-ufw-iptables(端口的开关)