フィルターのクリア

Why x, y-ticks are not shown in avi animation?

3 ビュー (過去 30 日間)
Takahiro
Takahiro 2017 年 3 月 17 日
コメント済み: Takahiro 2017 年 3 月 17 日
Why x, y-ticks are not shown in avi animation? Animation is made using VideoWriter(), getframe, writeVideo() functions.
turn=0;
v=VideoWriter('test.avi');
open(v);
set(gca,'nextplot','replacechildren');
N=20;
xx(1:N)=0;
plot( (1:N),'o-' );grid on;ylim([-1.5,1.5]);
title(sprintf('turn %d',turn));
xlabel('address');
ylabel('amplitude');
axis tight manual
for turn=1:100
xx=sin(2*pi*(1:N)*0.1+2*pi*turn*0.01);
plot( (1:N),xx,'o-' );grid on;ylim([-1.5,1.5]);
title(sprintf('turn %d',turn));
legend( sprintf('turn:%d',turn) );
xlabel('address');
ylabel('amplitude');
frame=getframe;
writeVideo(v,frame);
end
close(v);

採用された回答

KSSV
KSSV 2017 年 3 月 17 日
clc;
clear all ;
turn=0;
v=VideoWriter('test.avi');
open(v);
set(gca,'nextplot','replacechildren');
N=20;
xx(1:N)=0;
hfig = figure ;
h = plot( (1:N),xx,'o-' );grid on;ylim([-1.5,1.5]);
title(sprintf('turn %d',turn));
xlabel('address');
ylabel('amplitude');
% axis tight manual
for turn=1:100
xx=sin(2*pi*(1:N)*0.1+2*pi*turn*0.01);
set(h,'XData',(1:N),'YData',xx) ;
title(sprintf('turn %d',turn));
legend( sprintf('turn:%d',turn) );
xlabel('address');
ylabel('amplitude');
frame=getframe(hfig);
writeVideo(v,frame);
end
close(v);
  1 件のコメント
Takahiro
Takahiro 2017 年 3 月 17 日
Thanks! Your answer worked fine!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeAnnotations についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by