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.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
- América Latina (Español)
- Canada (English)
- United States (English)
欧洲
- 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)