How to plot a 2D vector-field and exclude zero-vectors (dots) in the graph?

4 views (last 30 days)
I plotted a vector field as written below:
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

Accepted Answer

Wolfgang Schwanghart
Wolfgang Schwanghart on 4 Jun 2011
How about:
I = ~(T(:,3)==0 & T(:,4)==0);
cheers, Wolfgang
  1 Comment
Emerson De Souza
Emerson De Souza on 4 Jun 2011
Vielen Dank Wolfgang,
es hat genau funktioniert,
wie ich gewuenscht habe.

Sign in to comment.

More Answers (0)


Find more on Graphics Performance in Help Center and File Exchange



Community Treasure Hunt

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

Start Hunting!

Translated by