Parts 4 and 5-- Stewart_plot.m
function Stewart_plot(x,y,theta,p1,p2,p3) %plots Stewart platform, given positions of corners in the following order: %bottom-left (u1,v1), top-left (u2,v2), and bottom-right (u3,v3). %strut beginning positions x0=0; %implied-- never included in book figures/equations y0=0; %implied-- never included in book figures/equations x1=4; y1=0; %implied-- never included in book figures/equations x2=0; y2=4; gamma=pi*(1/4); %solve for planar Stewart platform side points (via 1.38 equations) u1=x; v1=y; u2=x+p2*cos(theta+gamma); v2=y+p2*sin(theta+gamma); u3=x+p3*cos(theta); v3=y+p3*sin(theta); %plot red triangle (planar Stewart platform) and hold plot([u1 u2 u3 u1],[v1 v2 v3 v1],'r'); hold on %plot strut beginning points plot([x0,x1,x2],[y0,y1,y2],'bo') %plot strut length lines plot([x0 u1],[y0 v1],'b') plot([x1,u3],[y1,v3],'b') plot([x2 u2],[y2 v2],'b') %complete plot hold off
Not enough input arguments. Error in Stewart_plot (line 21) u1=x;