read
Read values of WPTREE
Description
returns the value of the wavelet packet tree value = read(T,propname,propparam)T property
specified by propname. propparam is an
optional parameter depending on the value of propname.
You can specify one or more properties in any order.
arguments must appear after other arguments. For example,
propname-propparam[value1,value2,value3,value4] =
read(T,.propname1,propname2,propname3,propparam3,propname4,propparam4)
Examples
Create a wavelet packet tree.
x = rand(1,512);
t = wpdec(x,3,"db3");
t = wpjoin(t,[4;5]);Display the tree.
plot(t)

Obtain the size of the data at every node in ascending node index order.
sAll = read(t,"sizes")sAll = 11×2
1 512
1 258
1 258
1 131
1 131
1 131
1 131
1 68
1 68
1 68
1 68
⋮
Obtain the size of the data at nodes of indices 0, 4 and 5.
sNod = read(t,"sizes",[0,4,5])sNod = 3×2
1 512
1 131
1 131
Obtain the entropy of all the nodes.
eAll = read(t,"ent")eAll = 11×1
116.3597
45.9147
39.1646
-30.2074
17.6607
20.8560
18.8364
-114.8913
11.4664
9.2578
9.0248
⋮
Obtain the entropy at nodes of indices 0, 4 and 5.
eNod = read(t,"ent",[0,4,5])eNod = 3×1
116.3597
17.6607
20.8560
Obtain the wavelet filters and wavelet coefficients.
[loD,hiD,loR,hiR] = read(t,"wfilters"); [loD1,loR1,hiD1,hiR1] = read(t,"wfilters","l","wfilters","h"); [max(abs(loD-loD1)) max(abs(hiD-hiD1)) ... max(abs(loR-loR1)) max(abs(hiR-hiR1))]
ans = 1×4
0 0 0 0
Obtain the wavelet coefficients at all nodes.
dAll = read(t,"data");Obtain the wavelet coefficients at nodes of indices 4 and 5.
dNod = read(t,"data",[4;5]); [ent,cfs4,cfs5] = read(t,"ent","cfs",4,"cfs",5); [max(abs(dNod{1}-cfs4)) max(abs(dNod{2}-cfs5))]
ans = 1×2
0 0
Plot the coefficients at node index 4.
plot(cfs4)
title("Node 4 Wavelet Coefficients")
Input Arguments
Wavelet packet tree, specified as a WPTREE
object.
Wavelet packet tree property name, specified as one of the following:
Property Name
( | Property Parameter
( |
|---|---|
"ent", "ento"
or "sizes" (see wptree) | Without |
"cfs" | With |
"entName",
"entPar", "wavName"
(see wptree) or
"allcfs" | Without |
"wfilters" (see wfilters) | Without |
"data" | Without |
Example: [value1,value2,value3,value4] =
read(T,"wavName","allcfs","cfs",4,"wfilters","h")
Parameter associated with the property propname,
specified as an integer or vector of integers.
Version History
Introduced before R2006a
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)