need function to compute iterations of element in matrix
Afficher commentaires plus anciens
hi every body i need matlab function to compute the number of iterations of one elements in matrix just like in excel when u want to compute for example how much the No. 3 occur in some column = counif(a1:a10;"=3") { in excel } is there a function in matlab can do the same thinks
tanks in advance
Réponse acceptée
Plus de réponses (1)
Azzi Abdelmalek
le 28 Jan 2014
Modifié(e) : Azzi Abdelmalek
le 28 Jan 2014
A=[1 2 3;3 0 1;4 5 6;3 1 5]
n1=sum(A(:,1)==3) % number of 3 in the first column
n2=sum(A(:,3)==3) % number of 3 in the third column
1 commentaire
Abdulkareem
le 28 Jan 2014
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!