Documentation

wcodemat

Extended pseudocolor matrix scaling

Syntax

Y = wcodemat(X)
Y = wcodemat(X,NBCODES)
Y = wcodemat(X,NBCODES,OPT)
Y = wcodemat(X,NBCODES,OPT,ABSOL)

Description

wcodematrescales an input matrix to a specified range for display. If the specified range is the full range of the current colormap,wcodematis similar in behavior toimagesc.

Y = wcodemat(X)rescales the matrixXto integers in the range [1,16].

Y = wcodemat(X,NBCODES)rescales the inputXas integers in the range [1,NBCODES] . The default value ofNBCODESis 16.

Y = wcodemat(X,NBCODES,OPT)rescales the matrix along the dimension specified byOPT. Valid character vectors forOPTare:'column'(or'c'),'row'(or'r'), and'mat'(or'm').'rows'scalesXrow-wise,'column'scalesXcolumn-wise, and'mat'scalesXglobally. The default value ofOPTis'mat'.

Y = wcodemat(X,NBCODES,OPT,ABSOL)rescales the input matrixXbased on the absolute values of the entries inXifABSOLis nonzero, or based on the signed values ofXifABSOLis equal to zero. The default value ofABSOLis 1.

Examples

collapse all

Scale level-one approximation coefficients globally to the full range of the colormap.

Load an image.

loadwoman;

Get the range of the colormap.

NBCOL = size(map,1);

Obtain the 2D dwt using the Haar wavelet.

[cA1,cH1,cV1,cD1] = dwt2(X,'db1');

Display without scaling and with scaling.

image(cA1); colormap(map); title('Unscaled Image'); figure image(wcodemat(cA1,NBCOL)); colormap(map); title('Scaled Image');

Introduced before R2006a

Was this topic helpful?