I think this line:
|
tmp_hh = cumsum(h.*h); % hh(k) = h(1:k)'*h(1:k) |
should read:
tmp_hh = cumsum(tmp_h.*tmp_h);
Otherwise Matlab throws this error message:
"Identifier 'h' is not a function or a shared variable. To share 'h' with nested function, initialize it in the current scope."