Hi All,
I just finished a programming assignment in C that required to determine peak elevations from a grid, among other things. I usually try to double check all my work in Excel as the built in formulas are quite nifty for that sort of thing. I breezed through the assignment only to hit a stumper in Excel.
I have no idea how to use Excel to compare the North, South, East, and West neighbor values to determine a true peak.
Let's say you have 5x5 of elevation values. A true peak can only be determined when N, S, E, & W neighbors exist and are of a lesser elevation. Border values are excluded because they don't have four neighbors, so you're really only working with the bold data.
2050 2100 2300 2200 1850
1990 3000 4400 2000 1980
2000 3300 2000 2150 2150
2300 4000 2150 6000 2050
2150 2200 2300 2250 2200
Therefore, 4000 @B4, 4400 @C2, and 6000 @D4 would be the peaks. I'm really scaling this down for example's sake. The table of values can be massive, but I hope you get the idea.
Any ideas?
Bookmarks