How do I run MATLAB from the mac terminal?

조회 수: 409 (최근 30일)
Cristian Sanchez Montesinos
Cristian Sanchez Montesinos 2019년 2월 3일
댓글: Marco cazzaniga 2023년 2월 16일
I am trying to run MATLAB from the mac OS X terminal. I'm using macOS Mojave version 10.14.2, and MATLAB R2018b. What I'm doing is:
  • I open the terminal
  • Go to /Applications
  • pe MATLAB_R2018
However, I get the following:
-bash: MATLAB_R2018b: command not found
Can someone help me with this?
Thanks.

채택된 답변

Ken Atwell
Ken Atwell 2019년 2월 4일
I do this:
open /Applications/MATLAB_R2018b.app/
  댓글 수: 2
Cristian Sanchez Montesinos
Cristian Sanchez Montesinos 2019년 2월 5일
Thank you. I still don't get what I'm looking for. I do the following:
  • type on terminal: cd /Applications/MATLAB_R2018b.app/bin
  • type on terminal: ./matlab
which opends the GUI MATLAB application, but what I want is to open MATLAB within the terminal. I know that is possible, because I have done it on a Linux machine in the past. Now, I would like to do it on my macOS computer. Could you please help me with this?
Thanks.
Ken Atwell
Ken Atwell 2019년 2월 5일
Oh, within the Terminal. You probably want -nodesktop. See:

댓글을 달려면 로그인하십시오.

추가 답변 (2개)

Walter Roberson
Walter Roberson 2019년 2월 5일
alias matlab="/Applications/MATLAB_R2018b.app/bin/matlab -nojvm -nodesktop"
I put the above in my ~/.bash_profile
  댓글 수: 3
Walter Roberson
Walter Roberson 2019년 2월 9일
Yes. If you are using the default bash shell then when you start an interactive session the .bash_profile in your home directory is sourced. The command I show sets up a command named matlab to launch r2018b in terminal mode. It can be invoked by that name from the terminal no matter where you are cd to . It is effectively a shortcut for typing in the right hand side.
Cristian Sanchez Montesinos
Cristian Sanchez Montesinos 2019년 2월 12일
Thanks!

댓글을 달려면 로그인하십시오.


Peiwei Liu
Peiwei Liu 2021년 10월 20일
In terminal on mac, type this:
/Applications/Polyspace/R2019b/bin/matlab; exit;
Please adjust this to your own path. Works!

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

제품


릴리스

R2018b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by