how can i calculate how many number of times that 1 occurs.

 Akzeptierte Antwort

Azzi Abdelmalek
Azzi Abdelmalek am 13 Dez. 2014
Bearbeitet: Azzi Abdelmalek am 13 Dez. 2014
x=repmat(1:4,4,1) % Example
out=sum(x(:)==1)
%or
out=nnz(x==1)

Weitere Antworten (0)

Community Treasure Hunt

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

Start Hunting!

Translated by