필터 지우기
필터 지우기

I have an array of 1000 elements I need to do average of 100 elements so that my new array is of 10 elements...

조회 수: 3 (최근 30일)
I have an array of 1000 elements I need to do average of 100 elements so that my new array is of 10 elements...

답변 (1개)

Guillaume
Guillaume 2017년 3월 21일
reshape your array into 100 rows, take the mean across these 100 rows:
assert(mod(numel(yourarray), 100) == 0, 'number of elements is not a multiple of 100')
mean(reshape(yourarray, 100, []))

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by