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 - The Fusion of Science and Community**

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

# MATLAB Array Operations

Loading...

Similar Threads - MATLAB Array Operations | Date |
---|---|

Matlab Append new columns into Excel | Jun 20, 2016 |

Matlab Replace NaN with next element in Multidimensional Array | Apr 6, 2016 |

MatLab: array of numbers unequal distribution | Apr 1, 2015 |

Structure Arrays (matlab) | Jul 30, 2014 |

Array operations in Matlab? | Dec 5, 2004 |

**Physics Forums - The Fusion of Science and Community**