2-D interpolation with extrapolation value for out of range data.

조회 수: 5 (최근 30일)
Zee
Zee 2022년 4월 26일
편집: Matt J 2022년 4월 26일
Hello,
I would like to do 2-D polar interpolation for the points shown in the file. For the interpolation, I considered azimuth as X and elevation as Y with r as sample values V. X and Y values are indicated in radians.I would like to carry out interpolation for query points within the range of available dataset. However if my query point for Y lies outside the range then I would like to interpolate between these end values instead of extrapolating. Range for my query point for Y would be between 0 to 6.28 (ie 0 to 360 degree)
For instance if for a given X value from the file has the following corresponding Y and V values,
X1 = 0.348, Y1 = 6.067, V1= 49157.12
X2 = 0.348, Y2 = 0.2158, V2= 49157.12
Then I should get V3 as 49157.12 if my query points xq1 = 0.348 and yq1 = 6.1.
Whereas if I use griddata function its extrapolating the values and giving V3 as 50525. Interp2 function has an option to provide extravapval as nearest to get something what I am looking for but am not sure if thats the right function to use. Also am getting error for my input arguments while using Interp2 function that my values are not strictly monotonic. I tried to convert X and Y values as mesh grid but am still getting error.

답변 (1개)

Matt J
Matt J 2022년 4월 26일
편집: Matt J 2022년 4월 26일
Map X,Y to equivalent points that are always in bounds,
[u,v,w]=sph2cart(X,Y,1);
[X,Y]=cart2sph(u,v,w);

카테고리

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

제품


릴리스

R2011b

Community Treasure Hunt

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

Start Hunting!

Translated by