Sum Matrix excluding certain values

12 Ansichten (letzte 30 Tage)
Li Chng
Li Chng am 4 Dez. 2019
Beantwortet: Adam Danz am 4 Dez. 2019
MatrixA = [1:10 ; 21:30 ; 8:17]
how to sum all the elements inside matrix A, if the element is greater than 3?

Akzeptierte Antwort

Adam Danz
Adam Danz am 4 Dez. 2019
y = sum(MatrixA(MatrixA > 3))

Weitere Antworten (0)

Kategorien

Mehr zu Creating and Concatenating Matrices finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by