Mapping Toolbox    
rc2yx

Compute row and column indices for x- and y-coordinates

Syntax

Description

[ygrat,xgrat] = rc2yx(rowgrat,colgrat,y1,x1,yperrow,xpercol) computes y- and x-coordinates from row and column indices. rowgrat and colgrat are matrices of the same size containing integer row and column indices for a grid with the upper left corner at the Cartesian coordinates x1 and y1. yperrow and xpercol are the y- and x-increments per row and column. The outputs ygrat and xgrat are the Cartesian coordinates corresponding to matrix locations rowgrat and colgrat.

Examples

Remarks

This function is used in the process of extracting projected matrix data from a file. The process generally consists of the following steps: 1) define the map projection as described in the data source documentation, 2) map desired geographic limits into projected coordinates using mfwdtran, 3) use yx2rc to determine associated row and column limits in the stored matrix, 4) extract sub-matrix using readmtx, 5) convert graticule of row and column indices to projected x and y coordinates using rc2yx, 6) convert x and y to geographic graticule using minvtran.

See Also
yx2rc
x- and y-coordinates to row and column indices
readmtx
Read a matrix stored in a file


  rad2km, rad2nm, rad2sm rcurve