how to plot this ?

7 次查看(过去 30 天)
diadalina
diadalina 2019-4-21
评论: KSSV 2019-4-23
i have a circle and i want to plot his half radius in the same figure can anyone help me :
angle=linspace(0,2*pi,360);
x=cos(angle);
y=sin(angle);
plot(x,y)
axis('equal')
  3 个评论
diadalina
diadalina 2019-4-21
thank mr walter for your response, i mean by his half radius, the line that cuts its half radius
Walter Roberson
Walter Roberson 2019-4-21
Which angle should it be drawn at?

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2019-4-22
angle=linspace(0,2*pi,360)';
C = [0 0] ;
R = 1 ;
x=C(1)+R*cos(angle);
y=C(2)+R*sin(angle);
%
x1 = R/2*cos(angle) ;
y1 = R/2*sin(angle) ;
plot(x,y)
hold on
C1 = repmat(C,length(angle),1) ;
plot([C1(:,1) x1]',[C1(:,2) y1]')
axis('equal')
  4 个评论
diadalina
diadalina 2019-4-22
thank you mr walter for your help ;
KSSV
KSSV 2019-4-23
angle=linspace(0,2*pi,360)';
C = [0 0] ;
R = 1 ;
x=C(1)+R*cos(angle);
y=C(2)+R*sin(angle);
%
x1 = R*cos(0) ;
y1 = R*sin(0) ;
plot(x,y)
hold on
plot([C(:,1) x1]',[C(:,2) y1]')
axis('equal')

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by