Posts tagged with: matlab


Run matlab codes from terminal.

Sometimes it is necessary to run your matlab codes from terminal, likely when you are away on remote connection to your work station. Sometimes you need to run couple of matlab instances from same terminal with additional & sign at the end of the terminal command. Now I’ll show a basic command to be able to run youR *.m script from terminal.

matlabOn the terminal you and the directory where the matlab bin file is located you type that command.

./matlab -nodesktop -nosplash -r "run path/to/your/*.m/file"

DO NOT USE  .m FILE EXTENSION JUST LIKE YOU ARE CALLING A SCRIPT AT NATIVE MATLAB ENVIRONMENT.

After -r macro at the quote signs every thing you write is respected as a normal matlab code thus you might write any other execution sequence you want.

Share

Run Matlab On Remote Machine with GUI

Running Matlab Remotely: ssh -X

I wanted to run Matlab by logging into the university account remotely from my machine. Everything went fine except for the graphics. Matlab started in no graphics mode.

After bit of a search I found the solution. You have to set the X11 forwarding in you ssh configuration file. Here’s how to do it.

1. cd /etc/ssh
2. sudo vi ssh_config
3. uncomment the lines “ForwardAgent” and “ForwardX11”. Set their values to “yes”
4. sudo vi sshd_config
5. uncomment “X11Forwarding” and set it value to “yes” as well.

that’s it and you are good to go.

Type ssh -X username@domain

To test if everything works fine try running xclock once you log in. It should open up a graphical clock window.

Share