imsubtract
Subtract one image from another or subtract constant from image
Syntax
Z = imsubtract(X,Y)
Description
Z = imsubtract(X,Y)
subtracts each element in arrayY
from the corresponding element in arrayX
and returns the difference in the corresponding element of the output arrayZ
.X
andY
are real, nonsparse numeric arrays of the same size and class, orY
is a double scalar. The array returned,Z
, has the same size and class asX
unlessX
is logical, in which caseZ
is double.
If X is an integer array, elements of the output that exceed the range of the integer type are truncated, and fractional values are rounded.
Examples
See Also
Introduced before R2006a
Was this topic helpful?