Index error when using function
1 回表示 (過去 30 日間)
古いコメントを表示
I'm getting this error:
Array indices must be positive integers or
logical values.
Error in newton (line 16)
x = x - (f(x))/dx(x);
0 件のコメント
回答 (1 件)
James Tursa
2019 年 5 月 7 日
編集済み: James Tursa
2019 年 5 月 7 日
We need to see more of your code to be sure, but you likely have a variable named either f or dx that is shadowing a function of the same name. The solution is to pick a different name for this variable.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!