tags:

views:

351

answers:

3

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.

A: 

emacs matlab-mode to run a script? AFAIK, emacs modes are useful for viewing & editing files, to get color-coded source & to have things like proper tab spacing and open & close (parentheses) or {curly braces} being highlighted when closing blocks of code

anyway, I suppose you could

  1. start emacs
  2. Within emacs, attach a shell (M-x shell)
  3. using the shell created in #2 ssh to your remote machine
  4. Start matlab in command-line mode
Pete
This misses the point. Emacs can do a lot more than add visual sugar. With a proper mode, it becomes a full-fledged IDE (plus, you can play tetris, manage your email, chat on IRC...). I haven't used Matlab mode, but it most likely goes far beyond a simple command line.
Svante
+1  A: 

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?

jrockway
A: 

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"
second