need function to compute iterations of element in matrix
Show older comments
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
Accepted Answer
More Answers (1)
Azzi Abdelmalek
on 28 Jan 2014
Edited: Azzi Abdelmalek
on 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 Comment
Abdulkareem
on 28 Jan 2014
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!