creating array with specific condition

2 次查看(过去 30 天)
data= 689 x 1
% moving average values for the last 50 data
data_average(1)= mean(data(1));
data_average(2)= mean(data(1:2));
data_average(50)= mean(data(1:50));
.
data_average(51)= mean(data(2:51));
data_average(52)= mean(data(3:52));
.
data_average(689)=mean(data(640:689));
How I can vectorize this computation?

采纳的回答

Walter Roberson
Walter Roberson 2021-12-28

更多回答(1 个)

sermet OGUTCU
sermet OGUTCU 2021-12-29
Dear Walter, thank you very much for the solution.

类别

Help CenterFile Exchange 中查找有关 Image Processing Toolbox 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by