Using movmean to calculate mean of first and last element in array
5 ビュー (過去 30 日間)
表示 古いコメント
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?
0 件のコメント
採用された回答
Ive J
2022 年 3 月 22 日
What about this?
a = [1 5 8 10];
ma = movmean([a, a(1)], [0 1], 'Endpoints', 'discard')
2 件のコメント
その他の回答 (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!