0

I want to ssh into a Linux server from my macbook, and code Matlab, execute my Matlab code and see the figures that are produced by Matlab all through the one single SSH channel. I note that, I don't want to use x11 forwarding and prefer to see everything inside a SSH channel.

Can I have the above setup with vim? Or should I go for Emacs?

  • Are these figures text files? How do you expect to see them in a text editor, Vim or Emacs? – muru Apr 2 '16 at 2:06
  • No, the figures are matlab figures with .fig extension. – Admia Apr 2 '16 at 21:22
3

So, 1) editing your file using the SSH protocol and 2) executing your code remotely is possible using vim.

  1. vim scp://[user@]machine/path or vim, then :e scp://[user@]machine/path.
  2. :!/path/to/matlab some_matlab_file.m

However, your request to view your figures through SSH is impossible without using some window/display manager to view your images. So, in the SSH case, X11 forwarding would have to be used. Of course, you could alternatively use VNC or remote desktop to access this machine (assuming it supports either of those protocols and you have the proper permissions to use those applications on the remote).

Note that this issue would not be ameliorated with emacs/any text editor. This is a limitation of SSH, which is just designed as a secure shell (SSH), i.e. text-based, protocol.

However, one option would be to generate .fig files from your MATLAB code and use SCP to copy those files onto your local machine. If you have a copy of MATLAB installed on the local machine, then you could view your figures.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.