How to rotate?
이전 댓글 표시
I want to modify the following program like the following figure.

a=0.5;
b=2;
m = 1000;
x = zeros(m,1);
y = zeros(m,1);
theta = linspace(0,2*pi,m);
for k = 1:m
x(k) = a * cos(theta(k));
y(k) = b * sin(theta(k));
end
for a=0:0.5:1
for xc = 1:-1:0
R = [cos(a) -sin(a); ...
sin(a) cos(a)];
rCoords = R*[x' ; y'];
xr = rCoords(1,:)';
yr = rCoords(2,:)';
yc = 1;
grid on;
axis equal;
end
hold on
plot(xr+xc,yr+yc,'b');
end
댓글 수: 1
Ameer Hamza
2020년 5월 30일
The pasted code in incomplete.
채택된 답변
추가 답변 (1개)
Image Analyst
2020년 5월 30일
1 개 추천
See my attached demos.


카테고리
도움말 센터 및 File Exchange에서 Simulink에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
