필터 지우기
필터 지우기

Plotting a set of unit vectors in 2-D

조회 수: 2 (최근 30일)
bio lim
bio lim 2015년 10월 22일
댓글: Star Strider 2015년 10월 22일
I am trying to figure out what is the best way to plot a set of unit vectors in 2-D anchored at (0,0). I am defining my rotational matrix (R) as follows.
R = [cosd(theta) -sind(theta); sind(theta) cos(theta)];
The angle of rotation is from 0 to 2pi such that it forms a unit circle. I also would rather use the regular plot command over plotv or quiver. Anyone has any suggestions?
Thanks.

채택된 답변

Star Strider
Star Strider 2015년 10월 22일
I’m not exactly certain what you want to do. I would do what you described with this:
a = linspace(0, 2*pi, 10);
r = 1;
x = r*cos(a);
y = r*sin(a);
o = zeros(size(a));
figure(1)
plot([o' x']', [o' y']')
axis equal
  댓글 수: 2
bio lim
bio lim 2015년 10월 22일
Great way. Thanks. I was just meddling with random problems.
Star Strider
Star Strider 2015년 10월 22일
My pleasure.
That was fun to program!

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 2-D and 3-D Plots에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by