Tabulate Not Adding Up?
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Respuestas (1)
the cyclist
el 14 de Ag. de 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 comentarios
Ver también
Categorías
Más información sobre Discrete Multiresolution Analysis en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!