This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Extended pseudocolor matrix scaling


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


wcodemat rescales an input matrix to a specified range for display. If the specified range is the full range of the current colormap, wcodemat is similar in behavior to imagesc.

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

Y = wcodemat(X,NBCODES) rescales the input X as integers in the range [1,NBCODES] . The default value of NBCODES is 16.

Y = wcodemat(X,NBCODES,OPT) rescales the matrix along the dimension specified by OPT. Valid character vectors for OPT are: 'column' (or 'c'), 'row' (or 'r'), and 'mat' (or 'm'). 'rows' scales X row-wise, 'column' scales X column-wise, and 'mat' scales X globally. The default value of OPT is 'mat'.

Y = wcodemat(X,NBCODES,OPT,ABSOL) rescales the input matrix X based on the absolute values of the entries in X if ABSOL is nonzero, or based on the signed values of X if ABSOL is equal to zero. The default value of ABSOL is 1.


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

load woman;
% 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
title('Unscaled Image');
% Display with scaling
title('Scaled Image');

Introduced before R2006a

Was this topic helpful?