How to store output when running MATLAB on a remote server?

3 views (last 30 days)
I know this has probably been answered before, but I'm unable to find it. If you could link me to a previous answer I'd appreciate it.
I'm running MATLAB on my school's supercomputer from my MacBook. The supercomputer is accessed through the terminal using Linux. I have limited knowledge about using the Mac terminal and Linux, but have taught myself enough to ssh into the remote server, sftp files to the remote server and back to my local machine. I'm using pre-written code from an admin at school that points to the MATLAB code in the working directory, but I need to know how to save the MATLAB output from the remote server into the working directory so I can transfer it to my local machine and ideally plot from my machine

Answers (1)

Swastik Sarkar
Swastik Sarkar on 27 Feb 2024
I understand that you are interacting with MATLAB in terminal mode by using the `-nodisplay` flag, given that you are connecting to the system via SSH to generate your plots.
For your situation, the `savefig` function will allow you to save your figures directly within the working directory, bypassing the need for a graphical display, because a simple SSH does not provide a graphical display to work on.
You can find detailed guidance on how to use the `savefig` function in the MATLAB documentation here:
Once you have saved your figure, you can transfer the file to your local machine. To view the figure, you can then utilize the `openfig` function, which opens the figure file for display. Here is the documentation for `openfig`:
Hope this Helps.

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!