Matlab plots
3 views (last 30 days)
Show older comments
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
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.
Accepted Answer
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on Matrices and Arrays in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!