Newtons Interpolation error code

Keep getting error Index exceeds the number of array elements (1).
I want to interpolate over T from [10:40] however cannot figure out the last for loop.

3 件のコメント

Ameer Hamza
Ameer Hamza 2020 年 12 月 1 日
You code use a function named 'Newton_interpolation'. It is not a builtin function. Can you show its definition?
Hayden Herrick
Hayden Herrick 2020 年 12 月 1 日
Yessir
Ameer Hamza
Ameer Hamza 2020 年 12 月 1 日
I don't get any errors when I run your code. I get the following graph. Are you running exactly the same code you attached to the question?

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

回答 (1 件)

Shubham Khatri
Shubham Khatri 2020 年 12 月 4 日

0 投票

Hello,
The code in one file seems to run fine on my end. The second code has the value of T missing which on adding to the code inside the function, works well.
What this error is saying is that at some point in that line you are exceeding the number of elements in an array. The (1) is indicating that the actual number of elements in the array is 1.
Hope it helps

カテゴリ

ヘルプ センター および File ExchangeInterpolation についてさらに検索

質問済み:

2020 年 12 月 1 日

回答済み:

2020 年 12 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by