* not a homework question. This is a practice question for an upcoming exam
Write a function, three_max, which takes three numbers, x1, x2, x3 and outputs the largest number. Do this without using the variety of built-in functions associated with max and sort. Test it.
I have created a function but when ever I try to test it I get a "not enough input arguments" for line 2: if (x1>x2 && x1>x3). I do not know what I am doing wrong
function three_max(x1,x2,x3) if (x1>x2 && x1>x3) max=x1; elseif (x2>x1 && x2>x3) max=x2; elseif (x3>x1 && x3>x1) max=x3; end end
Best Answer