video duration and multiple sublots in a single video

조회 수: 7 (최근 30일)
Gaetano Pavone
Gaetano Pavone 2020년 2월 18일
댓글: Gaetano Pavone 2020년 2월 19일
I have the following modified demo code for creating video:
Z = peaks;
surf(Z);
set(gca,'nextplot','replacechildren');
v = VideoWriter('peaks.avi');
open(v);
for k = 1:50
subplot(1,2,1);
surf(sin(2*pi*k/20)*Z,Z)
axis tight manual
subplot(1,2,2);
surf(sin(2*pi*k/20)*Z,Z)
axis tight manual
frame = getframe(gcf);
writeVideo(v,frame);
end
close(v);
I have the following questions:
  1. Why doesn't work "axis tight manual" well?
  2. How can I change the duration of the video?
  댓글 수: 2
Stijn Haenen
Stijn Haenen 2020년 2월 18일
You can change the frame rate with
v.FrameRate=60 %for 60Hz
I think you should place axis tight manual outside the for loop.
Gaetano Pavone
Gaetano Pavone 2020년 2월 19일
Thanks, it works!

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Audio and Video Data에 대해 자세히 알아보기

태그

제품


릴리스

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by