Moving Window for a specific Time

8 vues (au cours des 30 derniers jours)
Saad Alqahtani
Saad Alqahtani le 6 Juil 2021
Commenté : Saad Alqahtani le 6 Juil 2021
Hi,
So, the goal of this code is to calculate a Coefficient of Variation with time window of 5 seconds.
Here is my code.
% datanabs is a tourque value in Newton Meter
% t =(5*fsamp); moving window of 5 seconds
Mmean = movmean (datanabs,t); % mean of 5 seconds sliding window
Mstd = movstd(datanabs,t); % std of 5 seconds sliding window
CoV = (Mstd./Mmean)*100; % Here where I calcuulte the Coefficient of Variation
It's working but I think there is a better and efficint way to do it. Any help would be appreciated. Thanks in advance.
  2 commentaires
Saad Alqahtani
Saad Alqahtani le 6 Juil 2021
Got it. Thanks!

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Preprocessing Data 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