Find the positive entries in a matrix

3 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)

Categories

Find more on Special Functions 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!