如何在matlab中将gplot输出保存到文件?

时间:2012-04-06 06:23:20

标签: matlab graphics

你们可以建议保存/输出gplot到文件的方法。我仍在尝试使用Matlab解决问题。谢谢。

A=[0,1,1,1,1,1,0,0,0;
1,0,1,0,0,0,1,0,0;
1,1,0,1,0,0,1,0,0;
1,0,1,0,1,0,0,1,0;
1,0,0,1,0,1,0,0,1;
1,0,0,0,1,0,0,0,1;
0,1,1,0,0,0,0,1,0;
0,0,0,1,0,0,1,0,1;
0,0,0,0,1,1,0,1,0];

coords=[0 0;
.5 0;
1 0;
0 .5;
.5 .5;
1 .5;
0 1;
.5 1;
1 1];

gplot(A,coords)

1 个答案:

答案 0 :(得分:0)

我想你想把这个数字输出到一个文件:

 saveas(fig_handle, 'filename','bmp')

 print('-dbmp',fig_handle)

诀窍是在调用gplot之前你应该得到一个数字句柄

 fig_handle = figure