Not enough input arguments from a row vector
1 次查看(过去 30 天)
显示 更早的评论
My code is to find the roots of a quadratic using a row vector as the input. The function is called using myquad([3 4 5]) and I keep getting the error that i dont have enough input arguments. I am VERY new to matlab so please explain your answer like you're talking to a bump on a log.
function x = myquad(a,b,c)
if b^2 - 4*a*c > 0
x = 2;
else if b^2 - 4*a*c == 0
x = 1;
else
x = 0;
end
end
0 个评论
采纳的回答
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Loops and Conditional Statements 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!