Matlab plots

9 vues (au cours des 30 derniers jours)
sara
sara le 22 Juil 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 commentaire
Kaustubha Govind
Kaustubha Govind le 22 Juil 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.

Connectez-vous pour commenter.

Réponse acceptée

Robert Cumming
Robert Cumming le 22 Juil 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.

Plus de réponses (0)

Catégories

En savoir plus sur Startup and Shutdown dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by