Home > atmlab > geographical > edges2grid.m

edges2grid

PURPOSE ^

EDGES2GRID Gives centre points for ranges specified by their edges

SYNOPSIS ^

function g = edges2grid(e)

DESCRIPTION ^

 EDGES2GRID   Gives centre points for ranges specified by their edges

    Useful for e.g. defining the plotting position if the data are specified
    for data ranges. The data grid is assumed to be continous where *e* gives
    the edge between the ranges.

 FORMAT   g = edges2grid(e)
        
 OUT   g   Grid points.
 IN    e   Edges of grid ranges.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

DOWNLOAD ^

edges2grid.m

SOURCE CODE ^

0001 % EDGES2GRID   Gives centre points for ranges specified by their edges
0002 %
0003 %    Useful for e.g. defining the plotting position if the data are specified
0004 %    for data ranges. The data grid is assumed to be continous where *e* gives
0005 %    the edge between the ranges.
0006 %
0007 % FORMAT   g = edges2grid(e)
0008 %
0009 % OUT   g   Grid points.
0010 % IN    e   Edges of grid ranges.
0011 
0012 % 2006-03-27   Created by Patrick Eriksson.
0013 
0014 function g = edges2grid(e)
0015 
0016 g = e(1:end-1) + diff(e)/2;
0017

Generated on Mon 15-Sep-2014 13:31:28 by m2html © 2005