Using movmean to calculate mean of first and last element in array
9 views (last 30 days)
Show older comments
sr9497 on 22 Mar 2022
Commented: Ive J on 22 Mar 2022
I have an array [1 5 8 10] and using movmean with window length [0 1] this gives me [3 6.5 9 10]. Is there a way in which I can use movmean to calculate the mean of 10 and 1 as well and add that in the fourth position of the array?
What about this?
a = [1 5 8 10];
ma = movmean([a, a(1)], [0 1], 'Endpoints', 'discard')
More Answers (0)
Find more on Colormaps 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!