How to plot a 2D vector-field and exclude zero-vectors (dots) in the graph?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
I plotted a vector field as written below:
quiver(T(:,1),T(:,2),T(:,3),T(:,4))
where the variables
T(:,1) and T(:,2) are the x and y coordinates and
T(:,3) and T(:,4) are the x and y components.
However, many vectors have x and y components equal zero.
Thus, when I plot the field, many dots represents
the zero-vectors and disturb the visualization of
the field.
So I want to write some command lines
to exclude the plotting of the dots (zero-vectors).
I wonder if someone could help me with this
Thank you
Emerson
0 Kommentare
Akzeptierte Antwort
Wolfgang Schwanghart
am 4 Jun. 2011
How about:
I = ~(T(:,3)==0 & T(:,4)==0);
quiver(T(I,1),T(I,2),T(I,3),T(I,4));
cheers, Wolfgang
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Surface and Mesh Plots finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!