My "roots" command is not working and displaying an error (MATLAB 2017a) ver.

12 ビュー (過去 30 日間)
Haziq Zaheer
Haziq Zaheer 2020 年 5 月 14 日
コメント済み: Haziq Zaheer 2020 年 5 月 14 日
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?

採用された回答

Fangjun Jiang
Fangjun Jiang 2020 年 5 月 14 日
You are running your own roots.m SCRIPT, not the MATLAB roots() function.
  3 件のコメント
Fangjun Jiang
Fangjun Jiang 2020 年 5 月 14 日
Best way is to rename your roots.m to something else.
Haziq Zaheer
Haziq Zaheer 2020 年 5 月 14 日
Done, and yes it's perfectly running now. Thank you!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeStartup and Shutdown についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by