Mapping Toolbox | ![]() ![]() |
Replace entries of a matrix map specified by a mask matrix
Syntax
Description
mapout = maskm(map,mask,newcode) returns a matrix map mapout
identical to the matrix map, map
, except that every element corresponding to a 1 in mask
is replaced with the scalar value newcode
. mask
is a matrix of 1s and 0s, the same size as map
. The mask
can be the result of a logical operation on the variable map
(e.g., mask = (map>100)
). When no newcode
is supplied, NaN
s are inserted.
Examples
Use a logical test on the map as a mask. Replace with the default value (NaN)
:
See Also
changem |
Replace certain values in a matrix map |
![]() | maptrims | mat2dms | ![]() |