Index error when using function

1 回表示 (過去 30 日間)
kelly flannery
kelly flannery 2019 年 5 月 7 日
編集済み: James Tursa 2019 年 5 月 7 日
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);

回答 (1 件)

James Tursa
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.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by