`clc;clear all;d1=200;d2=1;a3=135;a4=135;a5=135;theta2=linspace(0,350,50);theta3=linspace(0,180,40);theta4=linspace(0,270,40);theta5=linspace(0,180,40);c2=cosd(theta2)c3=cosd(theta3);c5=cosd(theta5);c34=cosd(theta3+theta4);s2=sind(theta2);s3=sind(theta3);s5=sind(theta5);s34=sind(theta3+theta4);px = (a3.*(c2.*c3))-(a5.*((s2.*s5)-(c5.*c2.*c34)))+(a4.*c2.*c34);py = (a3.*c3.*s2)+(a5.*(c5.*s2.*c34)+(c2.*s5))+(a4.*s2.*c34);pz = d1(ones(1,50)) + d2 + (a3.*s3)+(a5.*c5.*s34)+(a4.*s34);`

[EDITED, Jan, please use a proper code formatting – thanks]

## Best Answer