Storing data from looping and calculate again
Show older comments
So i have this data
data =
2
3
1
4
5
6
the calculation that i need is find average from last 6 data and storing the result as last data, and keep repeating until certain data, in this case im trying until 5 new data. so from that data, my new data should be
newdata=
2
3
1
4
5
6
3.5
3.75
3.875
4.35
4.41
im still stuck until this code
clc
data=[2;3;1;4;5;6]
for i=1:5
newdata(i)=mean(data);
end
newdata'
2 Comments
KSSV
on 23 Mar 2017
You want to find the mean of every five numbers out of given data? Is it?
Accepted Answer
More Answers (0)
Categories
Find more on Creating and Concatenating Matrices 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!