nt_wpwr
PURPOSE 
[y,tweight]=nt_wpwr(x,w) - weighted power
SYNOPSIS 
function [y,tweight]=nt_wpwr(x,w)
DESCRIPTION 
CROSS-REFERENCE INFORMATION 
This function calls:
- nt_unfold y=nt_fold(x) - unfold 3D to 2D
- nt_vecmult y=nt_vecmult(x,v) - multiply all rows or columns of matrix by vector
This function is called by:
- nt_dss_repeat_cluster y=nt_dss_repeat_cluster(x,nkeep,cluster_size) - dss within clusters
- nt_inpaint function y=nt_inpaint(x,w) - weighted interpolation based on correlation structure
- nt_outliers [w,y]=nt_outliers(x,w,thresh,niter) - detect outliers based on weighted correlation structure
- nt_sns_cluster y=nt_sns_cluster(x,nneigbors,cluster_size) - sensor noise suppression within clusters
- nt_star [y,w,ww]=nt_star(x,thresh,closest,depth) - sensor noise suppression
- nt_star2 [y,w,ww]=nt_star2(x,thresh,closest,w) - sensor noise suppression
SOURCE CODE 
0001 function [y,tweight]=nt_wpwr(x,w)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 if nargin<2; w=[]; end
0012
0013 x=nt_unfold(x);
0014 w=nt_unfold(w);
0015
0016 if isempty(w)
0017 y=sum(x(:).^2);
0018 tweight=numel(x);
0019 else
0020 x=nt_vecmult(x,w);
0021 y=sum(x(:).^2);
0022 tweight=sum(w(:));
0023 end
0024
0025 if nargout==0;
0026 disp(num2str(y));
0027 clear y tweight
0028 end
Generated on Tue 27-Nov-2018 11:03:00 by m2html © 2005