Hello I need to write a function that the file name is count(a,b,c) to count how many positive number . what i have to write?

2 次查看(过去 30 天)
function [p]= count(a,b,c) ...... complet the rest code
  4 个评论

请先登录,再进行评论。

回答(1 个)

KSSV
KSSV 2018-5-31
编辑:KSSV 2018-5-31
If a is a vector use:
count_positive = nnz(a>0) ;

类别

Help CenterFile Exchange 中查找有关 Debugging and Analysis 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by