how can we calculate count of specific group in a row
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
abdul wahab aziz
am 22 Aug. 2016
Kommentiert: abdul wahab aziz
am 22 Aug. 2016
i have a matric
3 2 5,
3 2 5,
4 2 5,
4 2 5,
4 2 5,
i need output like this 3 2 5 *2*- where 2 and 3 of times occured
4 2 5 *3*
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 22 Aug. 2016
A=[3 2 5,
3 2 5,
4 2 5,
4 2 5,
4 2 5]
[ii,jj,kk]=unique(A,'rows','stable')
out=[ii,accumarray(kk,1)]
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Resizing and Reshaping Matrices finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!