time average of every 100 samples
Show older comments
hello all,
I have 4000 samples of data, and I want to take time average of every 100 or 99 samples and put the result in 100th position of another array.
Thanks in Advance.
2 Comments
PRANAV Abhyankar
on 23 Feb 2012
Sean de Wolski
on 23 Feb 2012
huh? If you do what I did, your vector is not reshaped outside of the calculation of the averages. the averages is what you're looking for per your description.
Answers (2)
Sean de Wolski
on 23 Feb 2012
averages = mean(reshape(x(:),100,[]))
Something like this?
Wayne King
on 23 Feb 2012
You can do something like this:
x = randn(4000,1);
x1 = reshape(x,100,40);
y = mean(x1);
Now you have the mean of every 100 samples. You can now put those values in another array as you wish.
Categories
Find more on Time Series Events in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!