Why would I be getting "NaN" from a matrix I entered?

조회 수: 1 (최근 30일)
Jack B
Jack B 2014년 10월 24일
댓글: Sean de Wolski 2014년 10월 28일
Hey all,
I seem to be getting a "NaN" from a matrix I entered as a variable while using the function griddata. Is there any obvious reason for this? Possibly difficulty interpolating a value?
  댓글 수: 1
Patrik Ek
Patrik Ek 2014년 10월 24일
편집: Patrik Ek 2014년 10월 24일
You have nan in your matrix? Your matrix was created with nan. Your input data is wrong? You are a victim of a practical joke involving team mates and corruption of data? Your computer decided that it wanted a retirement?...
Sorry, but no one is all knowing. The does most likely come from a bug in the implementation. Then we need to know where it went wrong. There is many ways to get nan, so the problem is what you did to get nan.

댓글을 달려면 로그인하십시오.

채택된 답변

Star Strider
Star Strider 2014년 10월 24일
We need to see your code. My guess is that you’re asking it to extrapolate.
  댓글 수: 3
Star Strider
Star Strider 2014년 10월 28일
My pleasure!
The griddata function won’t allow you to extrapolate, but interpn and some of its friends will. (The interpolation-extrapolation functions have different capabilities.) You may have to experiment to find a function that does what you want. Fortunately, they seem to share the same general argument list syntax.
There are several helpful links to other functions at the end of the griddata and other documentation pages that can help guide your search.
Sean de Wolski
Sean de Wolski 2014년 10월 28일
scatteredInterpolant supports extrapolation with a few different methods.

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Image Analyst
Image Analyst 2014년 10월 24일
Maybe you entered the letter "o" instead of zero?

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by