MATLAB Answers

Poulomi
0

How to determine location of point features inside filled contour

Asked by Poulomi
on 14 Nov 2015
Latest activity Edited by Walter Roberson
on 15 Nov 2015
Hi, I have used filled contour (contourfm) to generate contour levels of precipitation rate over the US. I have a few station gauge lat-long information. How can I find out which gauge falls under which contour levels? Is there any way to figure out this? Thanks

  0 Comments

Sign in to comment.

1 Answer

Answer by Walter Roberson
on 15 Nov 2015
Edited by Walter Roberson
on 15 Nov 2015
 Accepted Answer

Use the two-output version of histc(), with the first input being the value associated with the gauges of interest, and with second input being [-inf, the_contour_levels] (you get get() the contour level information from the contour object or contourgroup object if you let it choose the levels automatically.) The second output of histc() will then be the index number into the list of contour levels. For example,
V = [0.01 0.05 0.1 0.2];
contour(TheData, V); %using V as the levels
augmented_levels = [-inf, V, inf];
[~, bin] = histc(gauge_levels, augmented_levels);
Now gauge #K whose level was gauge_levels(K), fit into the range augmented_levels(bin(K)) <= the level < augmented_levels(bin(K)+1)

  0 Comments

Sign in to comment.