Possibilities of using for end loop in code
1 view (last 30 days)
I want to build an articulated pendulum, let say up to 15 pendulums. Here, I define the first two pendulums as:
x1 = (r1/2)*cos(theta1);
x2 = (r2/2)*cos(theta2)+ r1*cos(theta1);
y2 = (r2/2)*sin(theta2) + r1*sin(theta1);
y=[x1 0 y1 0 theta1 0 x2 0 y2 0 theta2 0];
but I'm not sure how to write it by using for end loop so that I could build it until 15 pendulums. Also, should there is another way to do it, I would highly appreciated to learn about that. Thanks in advance.