Hi, plz help me out in this problem

1 view (last 30 days)
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

Accepted Answer

Image Analyst
Image Analyst on 22 May 2015
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.

More Answers (0)

Categories

Find more on Get Started with MATLAB in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!