Extract values from a matrix

조회 수: 2 (최근 30일)
Patrick Chow
Patrick Chow 2019년 11월 15일
답변: Guillaume 2019년 11월 15일
let say I have a matrix:
[ 3 2 4 ; 3 5 1]
I want to extract all the values that are greater than 3 and use all these extracted values to find the mean value.
How should I approach this?

채택된 답변

Guillaume
Guillaume 2019년 11월 15일
mean(yourmatrix(yourmatrix >= 3)) %mean of all values greater than or equal to 3

추가 답변 (0개)

카테고리

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

제품

Community Treasure Hunt

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

Start Hunting!

Translated by