plotting with a rectangle
이전 댓글 표시
Hey guys,
i am working on the simulation of a falling rectangle and have done the formulas. Now i need to test it so i need to plot it. As I need to see if the rotation is correct, I need to plot with a rectangle over my center of gravity. My project advisor told me to plot 4 points and connect them which I did. How can I put the centroid of the rectangle over the center of gravity of my simulation so that it moves with its coordinates and deegres?
my rectangle:
clear all
x1 = [-1 1]
y1 = [0.5 0.5]
plot(x1,y1,'b-');
hold on;
plot([1 1],[0.5, -0.5],'b-');
hold on;
plot([1 -1],[-0.5 -0.5],'b-');
hold on;
plot([-1 -1],[-0.5 0.5],'b-');
xlabel('x');
ylabel('y');
axis([-2 2 -2 2]);
I hope you get my question, if not feel free to ask and I try to explain it better.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Graphics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!