Effacer les filtres
Effacer les filtres

Streamlines spacing in streamslice function

2 vues (au cours des 30 derniers jours)
Camille Grimaldi
Camille Grimaldi le 22 Août 2021
Commenté : Joel Fischer le 13 Juin 2022
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 commentaires
darova
darova le 25 Août 2021
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 le 13 Juin 2022
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.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Vector Fields dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by