Skip to content
Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
26 lines (23 sloc) 738 Bytes
function celnr=asub2ind(lat,dlon,nmr,rowcol)
% celnr=ASUB2IND(lat,dlon,nmr,[rownr colnr])
%
% Matches a equal-area grid row and 'column' number to a sequential cell index
%
% lat latitudes describing the grid, column vector [degrees]
% dlon longitudes describing the grid, column vector [degrees]
% nmr the number of cells per row in the grid
% rownr the row numbers of the requested cells
% colnr the 'column' numbers of the requested cells
%
% OUTPUT:
%
% celnr the requested running cell index vector
%
% SEE ALSO:
%
% AIND2SUB, ACOR2IND
%
% Last modified by fjsimons-at-alum.mit.edu, 06/13/2007
[rownr,colnr]=deal(rowcol(:,1),rowcol(:,2));
nmr=cumsum([0 ; nmr(:)]);
celnr=nmr(rownr)+colnr;
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.