Challenge

Week 2- 2R Robotic Arm Challenge

  • Step-wise explanation of your code.
clear all
close all
clc
%2R Robotic arm
%Inputs
l1 = 1;
l2 = 2;
theta1 = linspace ( 20 , 80 , 11);
theta2 = linspace (0, 50 , 11);
ct=1;
for i =1 : length(theta1);
Theta1 = theta1(i);
for j = 1: length (theta2);
Theta2 = theta2(j);
%coordinates
x1 = 0;
y1 = 0;
x2 = l1 * cosd(Theta1);
y2 = l1 * sind(Theta1);
x3 = x2 + l2 * cosd(Theta2);
y3 = y2 + l2 * sind(Theta2);
%plot
plot([x1 x2], [y1 y2],[x2 x3], [y2 y3], 'linewidth', 4 )
axis([-0.8 1.2 0 1.2])
pause(0.009);
M(ct) = getframe(gcf)
ct = ct + 1;
end
end
movie(M) ;
videofile = VideoWriter ( ' Robertarm.avi', 'uncompressed AVI');
open (videofile)
writeVideo(videofile,M)
close (videofile)
- Mention the errors faced while programming.
Most of the Errors were grammatical and some related to semicolons ,space , alphabatical.
Vedio link:
https://www.youtube.com/watch?v=e9TLP9Z5j0Y
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.