How to rotate?
Afficher commentaires plus anciens
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 commentaire
Ameer Hamza
le 30 Mai 2020
The pasted code in incomplete.
Réponse acceptée
Plus de réponses (1)
Image Analyst
le 30 Mai 2020
1 vote
See my attached demos.


Catégories
En savoir plus sur Simulink dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
