フィルターのクリア

Capture frames from 3D comet plot to make a movie

3 ビュー (過去 30 日間)
Ram
Ram 2012 年 8 月 29 日
Hello,
I am looking to capture frames from a comet plot and then stitch the frames together to form a movie. Can someone please help me?
Here is what I tried. I opened up comet3.m and I added the line 'M(iframe) = getframe' after the 'drawnow' command in the grow the body, primary loop, and clean up the tail segments. iframe is a counter that I increment inside the for loop in those segments. What happens is that the comet plot displays only the current position of the comet and does not display the previous pathways (which is undesirable).
Any help will be greatly appreciated.
Thanks

採用された回答

Kevin Claytor
Kevin Claytor 2012 年 8 月 30 日
I had the same problem as you when modifying comet3. I got the movie working, but the process eliminates the immeadiate tail of the comet, but leaves the track, so I think it will work for you. I wasn't quite clear on all the k, p and m indexing in comet3, so I reduced it to (removing the "%grow the body" and "%clean up the tail" sections;
function M = comet3(varargin)
...SNIP...
iter = 1;
% Primary loop
m = length(x);
for i = 1:m
set(head,'xdata',x(i),'ydata',y(i),'zdata',z(i))
set(tail,'xdata',x(1:i),'ydata',y(1:i),'zdata',z(1:i))
drawnow
M(iter) = getframe;
iter = iter+1;
end

その他の回答 (0 件)

カテゴリ

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