Running Matlab remotely
Mostrar comentarios más antiguos
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.
Respuestas (4)
the cyclist
el 16 de Mzo. de 2012
0 votos
I believe that the answer (and particularly the ideas in the comments) here
might help you.
Jason Ross
el 16 de Mzo. de 2012
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.
David
el 16 de Mzo. de 2012
0 votos
2 comentarios
Daniel Shub
el 16 de Mzo. de 2012
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.
horst
el 21 de Dic. de 2013
have you tried simply entering bash at first when you open your terminal?
Daniel Shub
el 16 de Mzo. de 2012
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 comentarios
Jason Ross
el 16 de Mzo. de 2012
You pulled that symlink solution right out of my head, Daniel! I had meant to list it but it fell out of my right ear ... it's probably the cleanest way to do it since that will likely be on the PATH already, and it will work for any user who logs into the machine.
Daniel Shub
el 16 de Mzo. de 2012
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
el 16 de Mzo. de 2012
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 :)
Categorías
Más información sobre Introduction to Installation and Licensing en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!