필터 지우기
필터 지우기

help for creating a 2D lookup table .

조회 수: 2 (최근 30일)
vvf vvff
vvf vvff 2020년 2월 23일
댓글: vvf vvff 2020년 2월 25일
I want to create a table F so that I could searh values ffrom the table by F(x,y). When I am using the scatteredInterpolant , some points i get inf values. Why it happens ??? for the neighboring values around x y , I got the right values. Thank you so much !!!!!!!!!!!!!!!!!!!
  댓글 수: 2
Cameron B
Cameron B 2020년 2월 24일
We are unable to help unless you post your table and the value(s) you would like to interpolate.
Walter Roberson
Walter Roberson 2020년 2월 24일
Suppose that you had two points (realmin, 0) and (3*realmin,10) and you ask to interpolate at 2*realmin. Δy = 10, Δx = 2*realmin. Δy/Δx = 5/realmin. But 1/realmin is the largest non-infinite number, so that is 5 times (almost infinity) which is infinity.
Therefore it is possible with locations very close together for interpolation to generate inf even though none of the data is inf or nan.

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

채택된 답변

Walter Roberson
Walter Roberson 2020년 2월 24일
My comment shows how inf can occur for non-infinite values even when examining data inside the region.
However, probably what is happening for you is that you are asking for values at a location outside the maximum triangulation of the scattered data, and you have your interpolation configured to return inf in that case.
More typical is for people to leave interpolation at the default, in which case requesting values outside of the triangulation gets you nan instead of inf.
  댓글 수: 3
Walter Roberson
Walter Roberson 2020년 2월 24일
Look at the options for scatteredInterpolant: you can change the interpolation method.
vvf vvff
vvf vvff 2020년 2월 25일
Thank you ! I haven't noticed that

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

추가 답변 (0개)

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by