Sum Matrix excluding certain values

5 visualizzazioni (ultimi 30 giorni)
Li Chng
Li Chng il 4 Dic 2019
Risposto: Adam Danz il 4 Dic 2019
MatrixA = [1:10 ; 21:30 ; 8:17]
how to sum all the elements inside matrix A, if the element is greater than 3?

Risposta accettata

Adam Danz
Adam Danz il 4 Dic 2019
y = sum(MatrixA(MatrixA > 3))

Più risposte (0)

Categorie

Scopri di più su Creating and Concatenating Matrices in Help Center e File Exchange

Tag

Community Treasure Hunt

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

Start Hunting!

Translated by