MATLAB: Not enough input arguments.

errorMATLAB

function [theta4_1,theta4_2] = assignment2(theta2,r1,r2,r3,r4)
A=r3^2-r2^2-r4^2+(2*r1*r2*cos(theta2))+(2*r4*(r1-(r2*cos(theta2))));
B=4*r1*r2*sin(theta2);
C=r3^2-r1^2-r2^2-r1^2+(2*r1*r2*cos(theta2))-2*r4*(r3-(r2*cos(theta2)));
delta=B^2-(4*A*C);
if delta<0
theta4_1=[];
theta4_2=[];
elseif delta==0
theta4_1=(-B/(2*A));
theta4_2=(-B/(2*A));
else
theta4_1=(-B+sqrt(delta))/(2*A);
theta4_2=(-B-sqrt(delta))/(2*A);
end

Best Answer

You need to go to the command line and provide specific values for the inputs, such as
[out1, out2] = assignment2(pi/17, 2.7, 3.1, 1.8, 5.9)