作者lazyme (懒洋洋)
看板MATLAB
标题Re: [问题] 能不能将绘图直接存成图档 但是不要显 …
时间Fri May 4 10:36:25 2012
我参考了这边文章
可是却失败了 请大家帮我看看问题出在哪里 感激不尽
for tt1=1:5
for tt2=1:3
h=figure('Visible', 'off');
plot(Kt, AA, 'b', Kt, BB,'r--','linewidth' , 2);
set(gca,'FontWeight','bold');set(gca,'FontSize',14);
legend('AA','BB')
xlabel('k_t');
ylabel('Output');
title(['Results ',th1,'nm, ',th2,'nm']);
str1=sprintf('Output_%dnm_%dnm',vt1(tt1),vt2(tt2));
saveas(h,str1,'jpg');
saveas(h,str1,'bmp');
end
end
出现错误讯息:
Warning: Failed in CreateCompatibleBitmap, last error code 00000057
> In C:\Program
Files\MATLAB\R2010a\toolbox\matlab\graphics\hardcopy.p>hardcopy at 21
In graphics\private\render at 143
In print at 291
In saveas at 155
??? Error using ==> print at 339
Out of memory. Type HELP MEMORY for your options.
Error in ==> saveas at 155
print( h, name, ['-d' dev{i}] )
※ 引述《airjaguar (捷豹)》之铭言:
: 我用回圈画了好几个图 分别存成不同档名的档案
: 以下是我写的程式码的一部份
: g=figure, subplot(2,2,1);plot(ep,tp,'g');xlabel('en');ylabel('t+'),
: subplot(2,2,2);plot(en,tn,'r');xlabel('en');ylabel('t-'),
: subplot(2,2,3);plot(e0,t0,'k');xlabel('en');ylabel('t0'),
: subplot(2,2,4);plot(ep,tp,'g');xlabel('en');ylabel('t+')
: hold on
: subplot(2,2,4);plot( en, tn,'r');xlabel('en');ylabel('t-')
: % 以上是全部存在同一张图片
: name = ['n=' int2str(n) 'd=' int2str(d) '.emf'];
: saveas(g, name);
: close(g);
: 是可以成功的依据回圈(for n=1:4)产生好几个图档
: 但是有两个讨人厌的地方
: 他会依照回圈在命令列重复显示 g=1 好几次 偏偏 ";" 不知道要加在哪里 囧
: 再来还有一个问题就是 我希望他只要存成图档就好
: 可是他边存 好像一定都会show出他当下在画的图
: 有人知道怎麽解决这两个问题吗??
: 感激不尽
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 123.193.32.62
1F:→ diva:Out of memory 是不是图太大了? 05/04 12:41
2F:推 vincent59:看样子也应该如同diva大说的 05/04 12:52
3F:→ vincent59:我发生过 memory exhausted XD 05/04 12:53