Running Matlab remotely
조회 수: 38 (최근 30일)
이전 댓글 표시
I currently have Matlab installed on a Linux Workstation with the Ubuntu OS. I've updated the .bashrc file so that the Matlab directory is set as a PATH, and that I can type "matlab" from an run the program from the terminal without problem.
However, when I ssh into my Linux Workstation from my MacBook pro and try to run Matlab remotely using Mac's "Terminal" application by typing "matlab", it returns the message "matlab: command not found".
I simply only need to run matlab from the terminal (no need for graphics). Any advice on this? I've tried to messing around with my .bashrc and .bash_profile files on the Linux machine and my Mac to no avail.
댓글 수: 0
답변 (4개)
the cyclist
2012년 3월 16일
I believe that the answer (and particularly the ideas in the comments) here
might help you.
댓글 수: 0
Jason Ross
2012년 3월 16일
It sounds like the remote workstation isn't set up to source your .bashrc file. As a quick test when you log in, you can do
. /path/to/your/.bashrc
And then see if you can start MATLAB after that. If you can, your system is not sourcing the file automatically. This could be because of a few reasons:
- The shell being used for login isn't bash -- it could, for example, be tcsh, so the .bashrc won't be sourced.
- The remote system isn't configured to source your .bashrc. Check in the /etc directory and look at bash.bashrc. You may need to do something to /etc/profile to have it source the file. Each system is a little different, but you can google around for how it works if the comments in the various files don't make sense.
댓글 수: 0
David
2012년 3월 16일
댓글 수: 2
Daniel Shub
2012년 3월 16일
It sounds like you have a solution. Please accept the best answer to this question and vote for other answers that where helpful in solving your problem.
Daniel Shub
2012년 3월 16일
While David has a working solution. Three other options are:
Create a symbolic link to the matlab binary in /usr/bin
sudo ln -s /usr/local/MATLAB/R2010b/bin/matlab /usr/bin/matlab
this will allow you to run MATLAB directly from the command line without having to add a path. Some people might link the current version to both /usr/bin/matlab and /usr/bin/matlab_r2011a (or whatever naming convention suits your fancy)
Another option instead of exporting the path is to simply supply the path when launching matlab
/usr/local/MATLAB/R2010b/bin/matlab
You can also add an rc file to your .ssh directory on the remote machine to add the path or source your bash.rc. something like Jason's
. /path/to/your/.bashrc
댓글 수: 3
Daniel Shub
2012년 3월 16일
Are there distros that do not have /usr/bin on the path by default? Are there users/sys admins who take /usr/bin off the path?
Jason Ross
2012년 3월 16일
With 4000+ versions of Linux + BSD out there (source: distrowatch.com), anything is possible :)
I would expect both /bin and /usr/bin to be on the path, though. I can't imagine someone taking them off them path, either. I've done that when I've fat-fingered a PATH setting in the past, and it's not pretty ... at all. "ls: not found" ... oops :)
참고 항목
카테고리
Help Center 및 File Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!