Clear Filters
Clear Filters

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 views (last 30 days)
function [p]= count(a,b,c) ...... complet the rest code
  4 Comments

Sign in to comment.

Answers (1)

KSSV
KSSV on 31 May 2018
Edited: KSSV on 31 May 2018
If a is a vector use:
count_positive = nnz(a>0) ;

Categories

Find more on Debugging and Analysis in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!