# refmatToWorldFileMatrix

Convert referencing matrix to world file matrix

## Description

example

W = refmatToWorldFileMatrix(refmat) converts the referencing matrix refmat to the world file matrix W.

Note

You can also create a world file matrix from a raster reference object.

• Convert a reference object to a world file matrix by using the worldFileMatrix function.

• Convert a reference object to a world file matrix and write the matrix to a file by using the worldfilewrite function.

## Examples

collapse all

Specify a sample referencing matrix. Then, convert the referencing matrix to a world file matrix.

refmat = [0 1; 1 0; -0.5 -90.5];
W = refmatToWorldFileMatrix(refmat)
W = 2×3

1.0000         0    0.5000
0    1.0000  -89.5000

## Input Arguments

collapse all

Referencing matrix, specified as a 3-by-2 matrix. A referencing matrix defines a transformation that maps intrinsic coordinates to world or geographic coordinates.

• For world coordinates, specify refmat so that $\left[\begin{array}{cc}{x}_{w}& {y}_{w}\end{array}\right]=\left[\begin{array}{ccc}{x}_{i}& {y}_{i}& 1\end{array}\right]\cdot refmat$, where (xi, yi) is a location in intrinsic coordinates and (xw, yw) is the same location in world coordinates.

• For geographic coordinates, specify refmat so that $\left[\begin{array}{cc}lon& lat\end{array}\right]=\left[\begin{array}{ccc}x& y& 1\end{array}\right]\cdot refmat$, where x and y specify a location in intrinsic coordinates and lat and lon specify the same location in geographic coordinates.

Data Types: double

## Output Arguments

collapse all

World file matrix, returned as a 2-by-3 matrix.

## Version History

Introduced in R2011a