Extract values from a matrix

3 次查看(过去 30 天)
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