MATLAB Answers

0

Extract values from a matrix

Asked by Patrick Chow on 15 Nov 2019 at 10:56
Latest activity Answered by Guillaume
on 15 Nov 2019 at 11:02
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.

1 Answer

Guillaume
Answer by Guillaume
on 15 Nov 2019 at 11:02
 Accepted Answer

mean(yourmatrix(yourmatrix >= 3)) %mean of all values greater than or equal to 3

  0 Comments

Sign in to comment.