My "roots" command is not working and displaying an error (MATLAB 2017a) ver.
3 views (last 30 days)
Show older comments
Haziq Zaheer
on 14 May 2020
Commented: Haziq Zaheer
on 14 May 2020
I want to find the roots to a cubic polynomial and I' trying to use the roots command but an error keeps on recurring. Here's what I did:
1- clc
2- p=[1 -20 -525 63];
3- r=roots (p)
_____________________________
Following errors keeps on displaying:
Attempt to execute SCRIPT roots as a function:
C:\Users\Haziq Zaheer\OneDrive\Documents\MATLAB\roots.m
Error in roots (line 3)
r=roots (p)
_____________________________
Any leads on how can I fix it, please?
0 Comments
Accepted Answer
Fangjun Jiang
on 14 May 2020
You are running your own roots.m SCRIPT, not the MATLAB roots() function.
3 Comments
More Answers (0)
See Also
Categories
Find more on Logical 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!