Sum Matrix excluding certain values

10 views (last 30 days)
MatrixA = [1:10 ; 21:30 ; 8:17]
how to sum all the elements inside matrix A, if the element is greater than 3?

Accepted Answer

Adam Danz
Adam Danz on 4 Dec 2019
y = sum(MatrixA(MatrixA > 3))

More Answers (0)


Find more on Creating and Concatenating Matrices in Help Center and File Exchange


Community Treasure Hunt

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

Start Hunting!

Translated by