Moving standard Deviation and Average

6 ビュー (過去 30 日間)
Jana Sarran
Jana Sarran 2023 年 4 月 28 日
コメント済み: Jana Sarran 2023 年 4 月 29 日
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?

採用された回答

Image Analyst
Image Analyst 2023 年 4 月 28 日
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 件のコメント
Jana Sarran
Jana Sarran 2023 年 4 月 29 日
Thank you!

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

その他の回答 (1 件)

Cameron
Cameron 2023 年 4 月 28 日
Use movmean and movstd.

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by