moving sum over multiple time windows

2 ビュー (過去 30 日間)
C.G.
C.G. 2022 年 4 月 7 日
コメント済み: C.G. 2022 年 4 月 7 日
I have a dataset Q_opss, and I want to find the maximum moving sum of the dataset over lots of different windows.
I have the code below to find the moving sum every 2 points, and then give me the maximum of this, but I want to do this operation for movsum windows 1:100.
Is there a way I can do this in a simple way?
M1_sum = movsum(Q,2,'EndPoints','discard');
M1 = max(M1_sum);

採用された回答

Jan
Jan 2022 年 4 月 7 日
M1 = zeros(1, 100);
for k = 1:100
M1(k) = max(movsum(Q, k, 'EndPoints','discard'));
end
  1 件のコメント
C.G.
C.G. 2022 年 4 月 7 日
Thank you!

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by