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

조회 수: 3 (최근 30일)
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

채택된 답변

Wolfgang Schwanghart
Wolfgang Schwanghart 2011년 6월 4일
How about:
I = ~(T(:,3)==0 & T(:,4)==0);
quiver(T(I,1),T(I,2),T(I,3),T(I,4));
cheers, Wolfgang
  댓글 수: 1
Emerson De Souza
Emerson De Souza 2011년 6월 4일
Vielen Dank Wolfgang,
es hat genau funktioniert,
wie ich gewuenscht habe.
Gruesse,
Emerson

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Surface and Mesh Plots에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by