Tabulate Not Adding Up?
5 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I've been using tabulate to generate a frequency table for my logical array. My code looks like this:
A.logical = [1;0;0;0;1;1;1;1;1;1];
A.logical.stats.freq = tabulate(A.logical);
And my resulting table SHOULD be
0 3 30
1 7 70
where column 1 is the numeric values, column 2 is frequency, and column 3 is percentage.
However, what I am getting is more like
0 300 30
1 700 70
Why is this happening and how can I fix it?
0 commentaires
Réponses (1)
the cyclist
le 14 Août 2015
Your code gave an error for me. I ran this code instead:
A.logical = [1;0;0;0;1;1;1;1;1;1]
Atab = tabulate(A.logical)
and ended up with
Atab =
0 3 30
1 7 70
as expected.
0 commentaires
Voir également
Catégories
En savoir plus sur Discrete Multiresolution Analysis 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!