Matlab plots

3 views (last 30 days)
sara
sara on 22 Jul 2011
Hi All
I need to use matlab and make plots. I am able to access my work computer form home using ssh and i did try opening matlab but it said that i cannot see the display. so how do i use matlab if i cannot see it , is there any code or command that i can use to run script and get plots
Thank you
  1 Comment
Kaustubha Govind
Kaustubha Govind on 22 Jul 2011
If you need to get plots, I think you need to enable display for MATLAB (if you just need to run scripts, you can run MATLAB using the -nojvm and -nodesktop options to disable display). I would recommend looking into VNC software or xterm so you can use display.

Sign in to comment.

Accepted Answer

Robert Cumming
Robert Cumming on 22 Jul 2011
As stated run with -nodesktop to get just the command window. It will be a bit more involved to produce plots as you will need to build dialogs and axes manually (but hidden, i.e. visibility set to off) some sample code to produce plots in pdf format:
d = dialog ( 'windowstyle', 'normal', 'visible', 'off' )
a = axes('parent', d );
plot ( a, rand(10,1), rand(10,1) );
print ( d, '-dpdf', 'tmp.pdf' );
exit
run by running at command line:
matlab -nodesktop < filename.m
EDIT: Forgot to add that you can then use ghostscript to combine all the individual pdfs into a single pdf.

More Answers (0)

Categories

Find more on Matrices and Arrays in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!