Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Matlab rectangle

  1. Dec 1, 2011 #1
    LEASE HELP!!!!!!!!

    -Add an axis to current rectangle
    -Draw both piece of arm
    -rotate object first axis 20 degree
    --redraw.
    -then, rotate 2nd part about 2nd axis to -30degree

    my current code for rectangle is
    %RECTANGLE('Position', [x y w h])
    w=4.5;

    %width
    h=.5;

    %height
    x=1.75;y=2.75;

    %corner position
    xv=[x x+w x+w x x];yv=[y y y+h y+h y];
    p1=patch(xv,yv,[0 0 0]);

    % original rectangle
    T=[-2 -2 -2 -2 -2;-3 -3 -3 -3 -3];
    axis equal;
    grid on;


    R(1,:)=xv;R(2,:)=yv;
    p=R+T;

    %Translation
    alpha=pi/9;
    XY=[cos(alpha) -sin(alpha);sin(alpha) cos(alpha)]*p;
    Y=patch(p(1,:),p(2,:),'k');
    F=patch(XY(1,:),XY(2,:),'k');
    T3=[2 2 2 2 2;3 3 3 3 3];
    B=XY+T3
    y=patch(B(1,:),B(2,:),'k');
     
  2. jcsd
  3. Dec 1, 2011 #2

    Pythagorean

    User Avatar
    Gold Member

    your instructions are vague, is this homework?
     
  4. Dec 1, 2011 #3
    yes, its my homeowrk..
    Tht's the instruction from my teacher.
     
  5. Dec 2, 2011 #4

    Pythagorean

    User Avatar
    Gold Member

    I have no context, so I don't really understand what you're trying to do or what your problem is.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Matlab rectangle
  1. Matlab concatenation (Replies: 2)

  2. Matlab and physics (Replies: 3)

  3. MATLAB problem (Replies: 1)

  4. MATLAB histogram (Replies: 3)

Loading...