Find the positive entries in a matrix

3 次查看(过去 30 天)
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?

回答(1 个)

Torsten
Torsten 2022-9-3
移动:Walter Roberson 2022-9-3
nnz(A>0)

类别

Help CenterFile Exchange 中查找有关 Special Functions 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by