Find the positive entries in a matrix

4 vues (au cours des 30 derniers jours)
Sofie Önnemar
Sofie Önnemar le 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?

Réponses (1)

Torsten
Torsten le 3 Sep 2022
Déplacé(e) : Walter Roberson le 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!

Translated by