Labfans是一个针对大学生、工程师和科研工作者的技术社区。 | 论坛首页 | 联系我们(Contact Us) |
![]() |
![]() |
#1 |
高级会员
注册日期: 2019-11-21
帖子: 3,006
声望力: 66 ![]() |
![]()
我有followinf的情况。我在文件夹中有包含数字数据的其他* .txt文件。我想将即将输出的绘图的图片保存在jpg文件中。伪代码将是这样的。
while(! more *.txt files in the folder) { plot(data) save_plot_data(plot1.jpg) } 最好的祝福 回答: 我会去这样的事情: files = dir('*.txt'); for i=1:numel(files) h = plot(load(files(i).name)); saveas(h,sprintf('plot%d.jpg',i),'jpg'); end 最好 更多&回答... |
![]() |
![]() |