Part 4-- xy_solv_4.m

function [xy]=xy_solv_4(theta)
%provides solution (x,y) of Stewart platform given theta (for part 4)


%platform sizes and parameters for the given problem
L_1=3;
L_2=3*sqrt(2);
L_3=L_1;

p_1=5;
p_2=p_1;
p_3=3;

x_1=5;

x_2=0;
y_2=6;

gamma=pi*(1/4);


%equation definitions from 1.38
A_2=L_3*cos(theta)-x_1;
B_2=L_3*sin(theta);
A_3=L_2*cos(theta+gamma)-x_2;
B_3=L_2*sin(theta+gamma)-y_2;


%D as the denominator in 1.39
D=2*(A_2*B_3-B_2*A_3);


%N_1 and N_2 as shown in 1.39
N_1=B_3*(p_2^2-p_1^2-A_2^2-B_2^2)-B_2*(p_3^2-p_1^2-A_3^2-B_3^2);
N_2=-1*A_3*(p_2^2-p_1^2-A_2^2-B_2^2)+A_2*(p_3^2-p_1^2-A_3^2-B_3^2);


%solve for x and y, via 1.39
x_sol=N_1/D;
y_sol=N_2/D;


%place solutions into single array
xy=[x_sol y_sol];
end
Not enough input arguments.

Error in xy_solv_4 (line 24)
A_2=L_3*cos(theta)-x_1;