MATLAB Answers

Moving Window for a specific Time

1 ビュー (過去 30 日間)
Saad Alqahtani
Saad Alqahtani 2021 年 7 月 6 日
コメント済み: Saad Alqahtani 2021 年 7 月 6 日
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 件のコメント
Saad Alqahtani
Saad Alqahtani 2021 年 7 月 6 日
Got it. Thanks!

サインインしてコメントする。

回答 (0 件)

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by