creating array with specific condition

2 Ansichten (letzte 30 Tage)
sermet OGUTCU
sermet OGUTCU am 28 Dez. 2021
Beantwortet: sermet OGUTCU am 29 Dez. 2021
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?

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 28 Dez. 2021

Weitere Antworten (1)

sermet OGUTCU
sermet OGUTCU am 29 Dez. 2021
Dear Walter, thank you very much for the solution.

Kategorien

Mehr zu Image Processing Toolbox finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by