Mapping Toolbox Previous page   Next Page
histr

Create spatial equirectangular histogram

Syntax

[lat,lon,num,wnum] = histr(lats,lons) returns the center coordinates of equal-rectangular bins and the number of observations, num, falling in each based on the geographically distributed input data. Additionally, an area-weighted observation value, wnum, is returned. wnum is the bin's num divided by its normalized area. The largest bin has the same num and wnum; a smaller bin has a larger wnum than num.

[lat,lon,num,wnum] = histr(lats,lons,units) specifies the standard angle unit string. The default value is 'degrees'.

[lat,lon,num,wnum] = histr(lats,lons,bindensty) sets the number of bins per angular unit. For example, if units is 'degrees', a bindensty of 10 would be 10 bins per degree of latitude or longitude, resulting in 100 bins per square degree. The default is one cell per angular unit.

Description

The histr function sorts geographic data into equirectangular bins for histogram purposes. Equirectangular in this context means that each bin has the same angular measurement on each side (e.g., 1º-by-1º). Consequently, the result is not an equal-area histogram. The hista function provides that capability. However, the results of histr can be weighted by their area bias to correct for this, in some sense.

Examples

Create random data:

Bin the data in 0.5-by-0.5 degree cells (two bins per degree):

The bins centered at 0.75ºN are slightly smaller in area than the others. wnum reflects the relative count per normalized unit area.

See Also

filterm
Geographic filter for data sets
hista
Spatial equal-area histogram


Previous page  hista hms2hm Next page

Learn more about the latest releases of MathWorks products:

 © 1994-2009 The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS