Streamlines spacing in streamslice function

3 ビュー (過去 30 日間)
Camille Grimaldi
Camille Grimaldi 2021 年 8 月 22 日
コメント済み: Joel Fischer 2022 年 6 月 13 日
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 Center および File ExchangeVolume Visualization についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by