aduric
aduric

Reputation: 2912

Is it possible for Emacs to run a Matlab shell that is located on a remote server?

I would like to be able to use Matlab-mode (matlab.el) to run a matlab shell. The only problem is, Matlab is located on a remote host. Is this even possible? If so, please explain. I'm currently playing around with tramp but to no avail.

Thanks.

Upvotes: 4

Views: 1617

Answers (3)

TNT
TNT

Reputation: 2511

@Yotham : I can't comment yet on earlier answers, but your problem (Script working, malab-shell command in emacs not) may be due to the fact that you didn't delete/rename your matlab.elc file?

This way emacs never gets to know of the change since it prefers .elc over .el files for speed.

Resolved the same issue for me.

cheers tnt

Upvotes: 1

second
second

Reputation: 28637

I just tried using the emacs matlab mode through ssh, no problem

had to make a script which loads matlab, couldn't just specify the command in matlab.el

so:

/home/second/remoteMatlab:

#!/bin/bash
ssh orac matlab -nodisplay

where orac is the host which has matlab. you can pass commands to ssh here. i use ssh config and key authentication so only need the hostname here

in matlab.el, find

    (defcustom matlab-shell-command 

and set to eg

(defcustom matlab-shell-command "/home/second/remoteMatlab"

Upvotes: 5

jrockway
jrockway

Reputation: 42674

I am not 100% sure what you are doing, but this seems possible. If you use Tramp (or sshfs, my personal choice) to edit a script on a remote machine, you will be able to run it on that remote machine. If you have a *shell* buffer open, it can easily be ssh'd to that remote machine. If you are doing something REPL-like where emacs sends input to this buffer that's connected to a process over ssh, it should still work. If it is communicating with a remote process over a socket, you can use ssh forwarding to make the socket appear local.

Anyway, there is not much gap between local and remote, so this should all work out.

Finally, to toe the (GNU) party line... have you tried Octave running locally?

Upvotes: 1

Related Questions