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
MATLAB: Not enough input arguments.
errorMATLAB
Best Answer