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일

0 개 추천

M1 = zeros(1, 100);
for k = 1:100
M1(k) = max(movsum(Q, k, 'EndPoints','discard'));
end

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

질문:

2022년 4월 7일

댓글:

2022년 4월 7일

Community Treasure Hunt

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

Start Hunting!

Translated by