MATLAB Answers

I need to plot a trajectory, of a point on circumference of a circle moving around its centre and centre is moving along its x-axis.

조회 수: 3(최근 30일)
Chetlal Mahto
Chetlal Mahto 20 Feb 2020
답변: KSSV 20 Feb 2020
% please help i dont undrestand

  댓글 수: 0

로그인 to comment.

답변(1개)

KSSV
KSSV 20 Feb 2020
% cicle
th = linspace(0,2*pi) ;
r = 1. ;
xc = r*cos(th) ;
yc = r*sin(th) ;
% center of circle movine along ax axes
x = linspace(0,15,100) ;
y = zeros(size(x)) ;
% plot
for i = 1:length(x)
figure(1)
for j = 1:length(xc)
plot(x(i)+xc(1:j),y(i)+yc(1:j)) ;
axis([-5 15 -2 2])
drawnow
end
end
Better is to use set. Read about it.

  댓글 수: 0

로그인 to comment.

이 질문에 답변하려면 로그인을(를) 수행하십시오.


Translated by