Assignment 6 (Partc) matlab code
Assignment 6 (Partc) matlab code
clc;
% Parameters
L1 = 1; % Length of link 1
L2 = 1; % Length of link 2
theta1 = 0;
theta2 = pi;
x_final = 1;
y_final = 1;
x = x_init;
y = y_init;
for i = 1:length(t)-1
% Update end-effector position incrementally
x = x + deltaX_step;
y = y + deltaY_step;
deltaTheta = J \ deltaXY;
dTheta1(i) = deltaTheta(1);
dTheta2(i) = deltaTheta(2);
end
disp(dTheta);
Result:
Columns 1 through 10
Columns 11 through 20
Columns 21 through 30
Columns 31 through 40
Columns 41 through 50
-0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -0.0000 -
0.0000 -0.0000 -0.0000
Columns 51 through 60
Columns 61 through 70
Columns 71 through 80
Columns 81 through 90
>>