plot pdf for a large size sequence
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
EEE
le 4 Avr 2014
Réponse apportée : Image Analyst
le 4 Avr 2014
I have got a sequence with size of 1 million. I want to plot a pdf for this sequence by putting same values together. Does anyone have any idea?
2 commentaires
Réponse acceptée
Azzi Abdelmalek
le 4 Avr 2014
A=[1 1 1 1 1 1 2 2 2 2 3 3 3]
[a,b,c]=unique(A)
out=accumarray(c,A') % corresponding to a'
[a' out]
Plus de réponses (1)
Image Analyst
le 4 Avr 2014
A million elements is not large at all - just a very small fraction of the number of elements in an ordinary digital image for example. It sounds like you just want the histogram. If you have all integers:
data = [1 1 1 1 1 1 2 2 2 2 3 3 3]
edges = 1 : max(data(:));
counts = histc(data, edges)
counts =
6 4 3
Though perhaps I misunderstood because you have 5,4,3 instead of 6,4,3. Can you explain how you got the 5? Did you just ignore the first element or something???
0 commentaires
Voir également
Catégories
En savoir plus sur Annotations dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!