th1 = 0;
th2 = 0;
th3 = 0;
th4 = 0;
th5 = 0;
th6 = 0;
display('Case 1');
T1 = [cos(th1) 0 -sin(th1) 0; sin(th1) 0 -cos(th1) 0; 0 -1 0 0; 0 0 0 1];
T2 = [cos(th2) -sin(th2) 0 (260*cos(th2)); sin(th2) cos(th2) 0 (260*sin(th2)) ; 0 0 1 0; 0 0 0 1];
T3 = [cos(th3) 0 sin(th3) (-30*cos(th3)); sin(th3) 0 -cos(th3) (-30*sin(th3)) ; 0 1 0 0; 0 0 0 1];
T4 = [cos(th4) 0 sin(th4) 0; sin(th4) 0 -cos(th4) 0; 0 1 0 270; 0 0 0 1];
T5 = [cos(th5) 0 sin(th5) 0; sin(th5) 0 -cos(th5) 0; 0 1 0 0; 0 0 0 1];
T6 = [cos(th6) -sin(th6) 0 0; sin(th6) cos(th6) 0 0; 0 0 1 90; 0 0 0 1];
T = T1 * T2 * T3 * T4 * T5 * T6;
display(T);
th1 = pi/2;
th2 = 0;
th3 = pi;
th4 = 0;
th5 = 0;
th6 = 0;
display('Case 2');
T1 = [cos(th1) 0 -sin(th1) 0; sin(th1) 0 -cos(th1) 0; 0 -1 0 0; 0 0 0 1];
T2 = [cos(th2) -sin(th2) 0 (260*cos(th2)); sin(th2) cos(th2) 0 (260*sin(th2)) ; 0 0 1 0; 0 0 0 1];
T3 = [cos(th3) 0 sin(th3) (-30*cos(th3)); sin(th3) 0 -cos(th3) (-30*sin(th3)) ; 0 1 0 0; 0 0 0 1];
T4 = [cos(th4) 0 sin(th4) 0; sin(th4) 0 -cos(th4) 0; 0 1 0 270; 0 0 0 1];
T5 = [cos(th5) 0 sin(th5) 0; sin(th5) 0 -cos(th5) 0; 0 1 0 0; 0 0 0 1];
T6 = [cos(th6) -sin(th6) 0 0; sin(th6) cos(th6) 0 0; 0 0 1 90; 0 0 0 1];
T = T1 * T2 * T3 * T4 * T5 * T6;
display(T);
Best Answer