Documentation Center

  • Trials
  • Product Updates

read

Read values of WPTREE

Syntax

VARARGOUT = read(T,VARARGIN)

Description

VARARGOUT = read(T,VARARGIN) is the most general syntax to read one or more property values from the fields of a WPTREE object .

The different ways to call the read function are

PropValue = read(T,'PropName') or
PropValue = read(T,'PropName','PropParam')

or any combination of the previous syntaxes:

[PropValue1,PropValue2, ] = 
read(T,'PropName1','PropParam1','PropName2','PropParam2', ) 

where 'PropParam' is optional.

The valid choices for 'PropName' and 'PropParam' are listed in this table.

PropNamePropParam
'ent', 'ento' or 'sizes' (see wptree)

Without 'PropParam' or with 'PropParam' = Vector of node indices, PropValue contains the entropy (or optimal entropy, or size) of the tree nodes in ascending node index order.

'cfs'

With 'PropParam' = One terminal node index. cfs = read(T,'cfs',NODE) is equivalent to cfs = read(T,'data',NODE) and returns the coefficients of the terminal node NODE.

'entName', 'entPar', 'wavName' (see wptree) or 'allcfs'

Without 'PropParam'. cfs = read(T,'allcfs') is equivalent to cfs = read(T,'data'). PropValue contains the desired information in ascending node index order of the tree nodes.

'wfilters' (see wfilters)

Without 'PropParam' or with 'PropParam' = 'd','r','l','h'.

'data'

Without 'PropParam' or with 'PropParam' = One terminal node index or 'PropParam' = Column vector of terminal node indices.In this last case, PropValue is a cell array. Without 'PropParam', PropValue contains the coefficients of the tree nodes in ascending node index order.

Examples

% Create a wavelet packet tree.
x = rand(1,512);
t = wpdec(x,3,'db3');
t = wpjoin(t,[4;5]);
plot(t);

% Click the node (3,0), (see the plot function).
l% Read values.

sAll = read(t,'sizes');
sNod = read(t,'sizes',[0,4,5]);  
eAll = read(t,'ent');
eNod = read(t,'ent',[0,4,5]);  
dAll = read(t,'data');
dNod = read(t,'data',[4;5]);
[lo_D,hi_D,lo_R,hi_R] = read(t,'wfilters');
[lo_D,lo_R,hi_D,hi_R] = read(t,'wfilters','l','wfilters','h');
[ent,ento,cfs4,cfs5]  = read(t,'ent','ento','cfs',4,'cfs',5);

See Also

| | | |

Was this topic helpful?