|
"Alex " <alaios@yahoo.com> wrote in message <jeej42$m37$1@newscl01ah.mathworks.com>...
> Dear all I have a data vector of 1601 elements and I want to reduce its size to 101, to be able to compare it with a vector of 101 elements.
>
> IS there in matlab any function that can reduce the 1601 elements to 101? The easier would be to take concecutive elements of the 1601 vector and find the mean value in such steps so to end to a 101 vector.
>
> Do you know if there is a function that can do that?
>
> B.R
> Alex
I don't have MATLAB installed on this computer,
but you should be able to use FILTER to take a
running average of your vector (in blocks of 16 say).
Then use only every 16th eleemnet of this vector.
Something like:
data = % your 1601 data vetctor
windowSize = 16;
x = filter(ones(1,windowSize)/windowSize,1,data);
y = x(1:16 :end)
You will have to play around with the last
statement to make y a 101 length vector.
|