Matlab plots

10 ビュー (過去 30 日間)
sara
sara 2011 年 7 月 22 日
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 件のコメント
Kaustubha Govind
Kaustubha Govind 2011 年 7 月 22 日
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.

サインインしてコメントする。

採用された回答

Robert Cumming
Robert Cumming 2011 年 7 月 22 日
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 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by