I need the matlab code for the folllowing for 5 equations al
I need the matlab code for the folllowing, for 5 equations
all the qs, Ls, and ds are variables, please name it as is
,-sin-1 13.3)- sin-1/I34 -dsl33-di 593.3 d1 3 4-tan-1 (-93.2 93,1 413 4- d5433-di 43,1 913 cos 1132 lacos sin 14-dsq1 ds913 ds918- Cos tan-1932 3,1 Cos-1Solution
Matlab code:
disp(\'enterValue\');
pi = 3.14159;
d1 = input(\'Enter d1 value\');
d2 = input(\'Enter d2 value\');
d3 = input(\'Enter d3 value\');
d4 = input(\'Enter d4 value\');
d5 = input(\'Enter d5 value\');
l1 = input(\'Enter l1 value\');
l2 = input(\'Enter l2 value\');
l3 = input(\'Enter l3 value\');
q34 = input(\'Enter q3,4 value\');
q33 = input(\'Enter q3,3 value\');
q32 = input(\'Enter q3,2 value\');
q31 = input(\'Enter q3,1 value\');
q14 = input(\'Enter q1,4 value\');
q13 = input(\'Enter q1,3 value\');
q23 = input(\'Enter q2,3 value\');
q12 = input(\'Enter q1,2 value\');
q22 = input(\'Enter q2,2 value\');
theta3 = asin((q34-(d5*q33)-d1)/l3);
theta4 = asin(q33) - theta3;
theta5 = atan(-q32/q31);
theta1 = acos((q14 - (d5*q13) - ((q13*cos(theta5)*((l3*cos(theta5)) + l2))/q31) + ((d4*q23*cos(theta5))/q31))/l1);
theta2 = acos((q12 * cos(theta5))/q31) -theta1;
fprintf(\'theta1 = %0.5f\',(theta1*180/pi));
fprintf(\'theta2 = %0.5f\',(theta2*180/pi));
fprintf(\'theta3 = %0.5f\',(theta3*180/pi));
fprintf(\'theta4 = %0.5f\',(theta4*180/pi));
fprintf(\'theta5 = %0.5f\',(theta5*180/pi));
