Tabulate Not Adding Up?
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
the cyclist
il 14 Ago 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 Commenti
Vedere anche
Categorie
Scopri di più su Discrete Multiresolution Analysis in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!