How to determine location of point features inside filled contour

1 次查看(过去 30 天)
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

采纳的回答

Walter Roberson
Walter Roberson 2015-11-15
编辑:Walter Roberson 2015-11-15
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 个)

Community Treasure Hunt

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

Start Hunting!

Translated by