subplotで複数のplotを一つのfigureウィンドウに描写した場合のキャプチャと動画保存について
Show older comments
subplotで3つのplotを一つのfigureで描写しました。
このfigureウィンドウを1ステップごとにキャプチャし,動画保存したいのですが,下記のようなエラーが表示されます。
========================================================================================
警告: 圧縮タイプに 'None' を使用すると、Indeo5 圧縮方式を使えません。 詳細は、Mathworks Technical Solution 1-4G50RI を参照してください。 エラー: audiovideo.internal.aviwriter/addframe>ValidateFrame (line 283) フレームは 1135 x 945 でなければなりません。
エラー: audiovideo.internal.aviwriter/addframe (line 153) ValidateFrame(aviobj,width, height,dims);
エラー: movie2avi (line 64) avimov = addframe(avimov,mov);
========================================================================================
フレームサイズが1135*945でなければならないということですが,
できれば下記のコードのようにfigureサイズを指定して保存したいと考えています。
指定したfigureサイズでキャプチャ,保存の仕方をご存知の方がいらっしゃいましたらご教授願います。
for t=1:time
fig=figure;
fig.Units='centimeters';
fig.Position=[10,2,30,25];
subplot(2,3,[2,3,5,6])
plot(x1,y1)
subplot(2,3,1)
plot(x2,y2)
subplot(2,3,4)
plot(x3,y3)
M(t)=getframe(gcf);
close
end
movie2avi(M,'plot.avi','fps',5)
都合上plotの詳細は伏せていますが,ステップ毎に更新や上書きされるグラフになっています。
Accepted Answer
More Answers (0)
Categories
Find more on オーディオとビデオ in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!