Borrar filtros
Borrar filtros

Streamlines spacing in streamslice function

2 visualizaciones (últimos 30 días)
Camille Grimaldi
Camille Grimaldi el 22 de Ag. de 2021
Comentada: Joel Fischer el 13 de Jun. de 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 comentarios
darova
darova el 25 de Ag. de 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 el 13 de Jun. de 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.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Vector Fields en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by