Sum of the element occurence
Mostra commenti meno recenti
Greetings Matlab Community,
I've manage to sum up the occurrence of number 2 of the entire matrix by using this,
chromo = [1 1 2 4 6 1 ; 2 1 3 5 7 2];
sum(chromo(:) == 2)
How do i sum up the occurrence of number 2 in just a row in the matrix and not the entire matrix?
Risposta accettata
Più risposte (2)
yiwen yim
il 29 Apr 2018
0 voti
1 Commento
Ameer Hamza
il 29 Apr 2018
Please delete this answer, and discuss it in the comment section.
yiwen yim
il 29 Apr 2018
0 voti
Categorie
Scopri di più su Creating and Concatenating Matrices in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!