Extract values from a matrix

1 回表示 (過去 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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by