Main Content

refmat2vec

(Removed) Convert referencing matrix to referencing vector

refmat2vec has been removed. Instead, convert referencing matrices to geographic raster reference objects using the refmatToGeoRasterReference function. For more information, see Version History.

Syntax

refvec = refmat2vec(R,s)

Description

refvec = refmat2vec(R,s) converts a referencing matrix, R, to the three-element referencing vector refvec. R is a 3-by-2 referencing matrix defining a two-dimensional affine transformation from pixel coordinates to spatial coordinates. s is the size of the array (data grid) that is being referenced. refvec is a 1-by-3 referencing vector having elements [cells/degree north-latitude west-longitude] with latitude and longitude limits specified in degrees.

Examples

% Convert a sample referencing matrix to a
% referencing vector.
N = rand(180,360);
refmat = [0 1; 1 0; -0.5 -90.5];
V = refmat2vec(refmat,size(N));

Version History

Introduced before R2006a

expand all

R2023b: Removed

Some functions that return referencing vectors have been removed, including the refmat2vec function. Instead, convert referencing matrices to geographic raster reference objects using the refmatToGeoRasterReference function. Reference objects have several advantages over referencing vectors.

  • Unlike referencing vectors, reference objects have properties that document the size of the associated raster, its geographic limits, and the direction of its rows and columns. For examples of reference object properties, see the GeographicPostingsReference object.

  • You can manipulate the limits of rasters associated with geographic reference objects using the geocrop function.

  • You can manipulate the size and resolution of rasters associated with geographic reference objects using the georesize function.

  • Most functions that accept referencing vectors as inputs also accept reference objects.

To update your code, replace instances of the refmat2vec function with the refmatToGeoRasterReference function.

rasterRef = refmatToGeoRasterReference(refmat,rasterSize);