You can use Emacs TRAMP to run matlab-shell on a remote system.
- First verify you can connect to the remote system in a terminal
For example, we can use ssh to connect:
ssh user@system pwdYou should configure your ssh keys to avoid prompting, which will make things smoother with Emacs.
- In Emacs visit a remote location.
A typical method is to use File menu to visit a file or
C-x C-fC-x C-f Find File: /ssh:USER@SYSTEM:~will open dired-mode to the USER home (~) directory on the remote SYSTEM.
- Run matlab-shell
With the current buffer as a remote location, e.g. dired-mode buffer of a remote location, run:
M-x matlab-shellmatlab-shell will copy files to the remote system and place them in
~/.emacs-matlab-shell/. These are needed for matlab-shell to work correctly on the remote system.If you get a message that Emacs couldn’t find matlab on the remote system, you need to tell Emacs where matlab is located and there are several ways to do this, see How TRAMP finds and uses programs on remote host. For example, suppose your remote system is Linux and you are using the Bash shell. You can setup your remote
/ssh:USER@HOST:~/.profileto place the location of MATLAB on your PATH:# ~/.profile PATH=/usr/local/MATLAB/Ryyyyab/bin/$PATH # Replace Ryyyyab with the MATLAB release you are using export PATH
After that you can add to your local
~/.emacs,(eval-after-load '(add-to-list 'tramp-remote-path 'tramp-own-remote-path))