フィルターのクリア

movie of particle tracking in MATLAB

7 ビュー (過去 30 日間)
Sanjana Singh
Sanjana Singh 2020 年 6 月 2 日
回答済み: Image Analyst 2020 年 6 月 14 日
I am writing a basic code to trace a streamline in MATLAB. I need to make a movie of the particles tracing a streamline (streakline). I know about streamparticles function but that isn't what I am looking for, I wish to select a particular streamline and trace a particle on that and record that motion. Is there some other method to accomplish this?

回答 (2 件)

darova
darova 2020 年 6 月 14 日
編集済み: darova 2020 年 6 月 14 日
Here is the modified example from MATLAB help. Extract data from streamline and make animation
clc,clear
[x,y] = meshgrid(0:0.1:1,0:0.1:1);
u = x;
v = -y;
quiver(x,y,u,v)
startx = 0.1:0.1:1;
starty = ones(size(startx));
h1 = streamline(x,y,u,v,startx,starty);
xx = get(h1(2),'xdata'); % extract data for line2
yy = get(h1(2),'ydata');
h = line(xx(1),yy(1),'marker','o','markersize',15); % draw marker at start position
for i = 1:length(xx)
set(h,'xdata',xx(i),'ydata',yy(i)) % change marker position
pause(0.05)
end

Image Analyst
Image Analyst 2020 年 6 月 14 日
If you want a movie, like an mp4 or avi video file, see my attached demo.

カテゴリ

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