[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vectorization
From: |
David Bateman |
Subject: |
Re: vectorization |
Date: |
Thu, 17 Jul 2008 00:38:05 +0200 |
User-agent: |
Thunderbird 1.5.0.7 (Windows/20060909) |
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.