Filter löschen
Filter löschen

Newtons Interpolation error code

1 Ansicht (letzte 30 Tage)
Hayden Herrick
Hayden Herrick am 1 Dez. 2020
Beantwortet: Shubham Khatri am 4 Dez. 2020
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 Kommentare
Hayden Herrick
Hayden Herrick am 1 Dez. 2020
Yessir
Ameer Hamza
Ameer Hamza am 1 Dez. 2020
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?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Shubham Khatri
Shubham Khatri am 4 Dez. 2020
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

Kategorien

Mehr zu Multidimensional Arrays finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by