vectorization

David Bateman David.Bateman at motorola.com
Wed Jul 16 17:38:05 CDT 2008


The final reshape should use size(a) and not size(A).. Thus the code

function q = newfilter1 (A, npoints)

  % assumes A is a muliple of npoints long
  a = reshape (A, npoints, numel(A) / npoints);
  q = reshape (repmat (min (abs(A - repmat(mean (A, 1), npoints, 1)), 
1),  npoints, 1), size (a));

endfunction

should be used instead. Untested as is the previous code.

D.


More information about the Help-octave mailing list