Interpolate data on a single point

7 views (last 30 days)
Hello All
I want to bilinearly interpolate some data that is occurring on one point in space. I have four files (939x1129 grid points) that all have the same coordinates and I want to find out where a certain percentage will occur on each of the grid points. Each grid point as four values:lat and lon(unneeded for this problem), rainfall amount(inches) and the probability(%) of that rainfall amount falling at that location.
(Rainfall amount, percent) (.5, 94%) (1, 87%) (1.5, 36%) (2, 10%)
What I need to find is the amount of rainfall that will match with two different probability (R1,5%) and (R2, 95%). I have been looking at interp2 and griddata but both seems to require a function input to work, which I don't have.
Andrew

Accepted Answer

Chad Greene
Chad Greene on 10 Aug 2017
Hi Andrew,
Your question is a little bit unclear. It would helpful to have a minimal working example, but from what I understand, I don't think you need to interpolate anything, and griddata is not necessary, as your matrices are already gridded.
For a rainfall matrix R with corresponding probabilities P, you can get a logical mask of all the grid points meeting a condition like
mask = P>=0.05 &P<0.10;
which would have ones wherever P is between 0.05 and 0.10, and zeros elsewhere. Then the corresponding rainfall in those grid cells is
R(mask)

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!