Streamlines spacing in streamslice function

2 次查看(过去 30 天)
Hi,
Just curious about what determines the spacing between the streamlines when using the streamslices function. It says it draws "well spaced streamlines", but not sure what that means.
When I use the matlab example:
load wind
vel=sqrt(u(:,:,1).^2+v(:,:,1).^2)
pcolor(x(:,:,1),y(:,:,1),vel);shading flat;hold on
streamslice(x(:,:,1),y(:,:,1),u(:,:,1),v(:,:,1))
It does not look like the streamlines are closer together when the velocities are higher, which makes me wonder why does the spacing changes.
Would appreciate if anyone has an anwser!
Cheers,
Camille
  2 个评论
darova
darova 2021-8-25
Looks like you created your own Z coordinate. But velocity field is standard.
[x,y,z] = peaks(30);
[u,v] = gradient(z);
ind = true(30);
ind(3:end-2,3:end-2) = false;
pcolor(x,y,z)
shading flat
streamline(x,y,u,v,x(ind),y(ind))
Joel Fischer
Joel Fischer 2022-6-13
Looking at the source code (R2021a) it appears the density of streamlines is not proportional to the magnitude of the vector field. Instead the algorithm tracks the local density on a grid to avoid placing new streamlines that whould come to close to already existing ones.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Vector Fields 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by