Find mean of arrays values which is bigger than threshold

Let`s say I have array (960x1280)of some numbers, and i want to find mean of numbers which are bigger than some threshold (e.g. 20).

답변 (1개)

Jos (10584)
Jos (10584) 2014년 3월 14일
The following will return the mean across all array elements.
tf = MyArray > Threshold
MyMean = mean(reshape(MyArray(tf),1,[]))
The reshape is needed in case all elements are above the threshold ...

카테고리

도움말 센터File Exchange에서 Numerical Integration and Differential Equations에 대해 자세히 알아보기

질문:

Adm
2014년 3월 14일

답변:

2014년 3월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by