# Moving standard Deviation and Average

10 vues (au cours des 30 derniers jours)
Jana Sarran le 28 Avr 2023
Commenté : Jana Sarran le 29 Avr 2023
how would I go about finding the moving standard deviation and moving average for every 15 rows of the SPEED COLUMN ONLY in the following matrix and display the results in another table?
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Réponse acceptée

Image Analyst le 28 Avr 2023
If you want to slide the 15 element window along an element at a time, use movmean and movstd.
If you want to move in "jumps" of 15 rows at a time, then you can either subsample the output of those functions or use blockproc in the Image Processing Toolbox. Or you can use a simple for loop:
% Compute speed over "blocks" of 15 elements
speed = t.Speed; % Get speed values from your table.
index = 1;
for k = 1 : 15 : numel(speed)
meanSpeeds(index) = mean(speed(k : k + 14));
index = index + 1;
end
##### 1 commentaireAfficher -1 commentaires plus anciensMasquer -1 commentaires plus anciens
Jana Sarran le 29 Avr 2023
Thank you!

Connectez-vous pour commenter.

### Plus de réponses (1)

Cameron le 28 Avr 2023
Use movmean and movstd.
##### 0 commentairesAfficher -2 commentaires plus anciensMasquer -2 commentaires plus anciens

Connectez-vous pour commenter.

### Catégories

En savoir plus sur Image Arithmetic dans Help Center et File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by