Sum Matrix excluding certain values

11 vues (au cours des 30 derniers jours)
Li Chng
Li Chng le 4 Déc 2019
MatrixA = [1:10 ; 21:30 ; 8:17]
how to sum all the elements inside matrix A, if the element is greater than 3?

Réponse acceptée

Adam Danz
Adam Danz le 4 Déc 2019
y = sum(MatrixA(MatrixA > 3))

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by