Using streamslice/quiver and inpolygon

10 visualizaciones (últimos 30 días)
Tomas Kojar
Tomas Kojar el 9 de Dic. de 2018
Editada: Tomas Kojar el 9 de Dic. de 2018
Suppose we have quiver field i.e. we have a meshgrid and then we assign a vector to each point. Is it possible to plot only the quiver field within some polygon? So in the figure below, I want everything outside the triangle to be cropped out.
Ideally the code will also be helpful for the next step of having multiple such polygons and cropping out everything on their complement.
Some approaches:
a)a direct way is to figure out the meshgrid for the particular polygon and then assign a vector to each point. But that will take a lot of time to figure out as polygons get more complicated
b)use inpolygon. The input of inpolygon are points in (x,y). But in my case I only have the vector field. One idea is to solve the ode system to obtain concrete solution pairs (x,y) to plug into the polygon. But solving them takes a lot longer and the pictures are not as nice.

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