Image Processing Toolbox User's Guide Previous page   Next Page
mat2gray

Convert a matrix to a grayscale intensity image

Syntax

Description

I = mat2gray(A,[amin amax]) converts the matrix A to the intensity image I. The returned matrix I contains values in the range 0.0 (black) to 1.0 (full intensity or white). amin and amax are the values in A that correspond to 0.0 and 1.0 in I.

I = mat2gray(A) sets the values of amin and amax to the minimum and maximum values in A.

Class Support

The input array A can be logical or numeric. The output image I is double.

Example

See Also

gray2ind


Previous page  maketform mean2 Next page

© 1994-2005 The MathWorks, Inc.