Find the positive entries in a matrix

4 views (last 30 days)
Sofie Önnemar
Sofie Önnemar on 3 Sep 2022
Moved: Walter Roberson on 3 Sep 2022
Write a function positivecounter.m that takes as an input matrix A and gives as an output the number of positive entries in matrix A. But how do I compute this problem?

Answers (1)

Torsten
Torsten on 3 Sep 2022
Moved: Walter Roberson on 3 Sep 2022
nnz(A>0)

Community Treasure Hunt

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

Start Hunting!