Hi,(adsbygoogle = window.adsbygoogle || []).push({});

How can I find the following from an array with entries of 0, 1, and >1:

Find the sum of all the entries in the matrix that are not equal to 0.

Find the sum of all the entries in the matrix.

Find the sum of all the zero and 1 entries in the matrix.

How to remove the entries in the matrix that are not equal to 0, one by one.

Thanks!

**Physics Forums | Science Articles, Homework Help, Discussion**

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# MATLAB Array Operations

**Physics Forums | Science Articles, Homework Help, Discussion**