new column with running average of existing column
2 views (last 30 days)
Show older comments
I am trying to create a new column that has the average of the 10 data points before and after that time point from an existing column (peak heights). Obviously there will be some difficulty for the first 10 and last 10 rows.
0 Comments
Accepted Answer
Star Strider
on 7 Mar 2022
Try this —
T1 = table(randn(20,1))
T1.Var2 = movmean(T1.Var1,[10 10])
.
0 Comments
More Answers (0)
See Also
Categories
Find more on Data Types 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!