Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Rotating Shapes

Subject: Rotating Shapes

From: Susan

Date: 17 Sep, 2010 12:02:04

Message: 1 of 1

Hi,

I'm having trouble with my code; I simply want to rotate my shape (2D rectangle) about it's centre point by degree values set by me. Here's my code:

daspect([1,1,1]);
deg = 100;

for i = 1:1:deg
p1 = rectangle('Position',[2,2,0.5,4.5],...
          'Curvature',[1,1],...
         'LineWidth',1,'LineStyle','-','FaceColor','r');
     rotate(p1,[1 1],i,[2.25 4.25]);
end

I'd appreciate any help!

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us