MATLAB Answers

Extract values from a matrix

18 views (last 30 days)
Patrick Chow
Patrick Chow on 15 Nov 2019
Answered: Guillaume on 15 Nov 2019
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?

  0 Comments

Sign in to comment.

Accepted Answer

Guillaume
Guillaume on 15 Nov 2019
mean(yourmatrix(yourmatrix >= 3)) %mean of all values greater than or equal to 3

  0 Comments

Sign in to comment.

More Answers (0)


Translated by