Hi, plz help me out in this problem

1 次查看(过去 30 天)
Hi, I am trying to find roots of the equation in Matlab, using code "ist line: p = [ 2 22 0 184] 2nd line: r = roots(p)" but I get the message "??? Attempt to execute SCRIPT roots as a function:"........so what should I do...help me plz

采纳的回答

Image Analyst
Image Analyst 2015-5-22
You didn't happen to call your m-file roots.m did you? If so, then when it runs this script, it tries to call itself as a function when it hits this line:
r = roots(p)
So it's trying to recursively call itself. But it's not a function that takes any arguments - it's just a simple script, so you get that error.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Get Started with MATLAB 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by