필터 지우기
필터 지우기

Newtons Interpolation error code

조회 수: 2 (최근 30일)
Hayden Herrick
Hayden Herrick 2020년 12월 1일
답변: Shubham Khatri 2020년 12월 4일
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
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일
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

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by