필터 지우기
필터 지우기

How to find the average in for loop?

조회 수: 2 (최근 30일)
Jiyeon Jang
Jiyeon Jang 2021년 5월 20일
댓글: Jiyeon Jang 2021년 5월 20일
for j = 1 : 1 : 10
Ry = max(Y(160 * (j-1) + 1:160*j)) + abs(min(Y(160 * (j-1) + 1:160*j)));
end
In this code, How to find the average of Ry in for loop?

답변 (1개)

KSSV
KSSV 2021년 5월 20일
avg = 0 ;
for j = 1 : 1 : 10
Ry = max(Y(160 * (j-1) + 1:160*j)) + abs(min(Y(160 * (j-1) + 1:160*j)));
avg = avg + Ry ;
end
avg = avg/j ;

카테고리

Help CenterFile Exchange에서 Loops and Conditional Statements에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by