⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unpackstatvalue.m

📁 老外写的小波变换的工具箱
💻 M
字号:
function s = UnpackStatValue(btree,stree)
% UnpackStatValue -- Unpack the value for given basis from the stat tree
%  Usage
%    s = UnpackStatValue(btree,stree)
%  Inputs
%    btree        basis tree
%    stree        stat tree
%  Outputs
%    s            stat value
%
%  Description
%    When using the BestBasis function, the stat value is both printed out
%    and stored in the first entry of vtree when called via
%         [btree,vtree] = BestBasis(stree,D)
%
%    It may be interesting to examine the stat value for a basis other than
%    the ``best'' chosen by the Coifman-Wickerhauser algorithm, e.g. for a
%    basis constructed by MakeBasis.
%
%  See Also
%    BestBasis, CalcStatTree, MakeBasis
%

	n = length(btree);
	s = 0;
%
% initialize tree traversal stack
%
	dstack = zeros(1,n+1);
	bstack = zeros(1,n+1);
	k = 1;
	dstack(k) = 0;
	bstack(k) = 0;
%
	while(k > 0),
		d = dstack(k); b = bstack(k); k=k-1;
		if (btree(node(d,b)) == 0) ,  % terminal node
			s = s + stree(node(d,b));
		else
			k = k+1;
			dstack(k) = d+1; bstack(k) = 2*b;
			k = k+1;
			dstack(k) = d+1; bstack(k) = 2*b+1;
		 end
	end

%
% Copyright (c) 1995.  Jonathan Buckheit
%
    
    
  %%  Part of Wavelab Version 850%  Built Tue Jan  3 13:20:41 EST 2006%  This is Copyrighted Material%  For Copying permissions see COPYING.m%  Comments? e-mail wavelab@stat.stanford.edu 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -