フィルターのクリア

save animation ,i need help

3 ビュー (過去 30 日間)
sofiane benhamza
sofiane benhamza 2020 年 9 月 23 日
回答済み: Peter O 2020 年 9 月 24 日
w=linspace(1,100,46);s=linspace(1,100,200);clf; %i made this simple animation , but i have no idea how to save it as a .gif or .wav, .mp4
for k=1:201 %i want it as an animation , i could even screen it , but it's gonna take time from me
axis([-101 101 -101 101]);set(gca,'color','k');hold on %thank you anyway
if k >= 32
plot(w(k)*cos(s),w(k)*.5*sin(s),'y--')
pause(.1)
else
plot(w(k)*cos(s),w(k)*sin(s),'y--')
pause(.1)
end
end

回答 (1 件)

Peter O
Peter O 2020 年 9 月 24 日
Sofiane,
Take a look at the VideoWriter and getFrame functions:
Specifically, look at the "Create AVI File from Animation" example towards the bottom of the page. You can get an AVI or MP4 working pretty easily this way. After that it can be converted to an animated gif.
Hope this helps!

カテゴリ

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

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by