Effacer les filtres
Effacer les filtres

How do I change step interval in a frequency table in matlab

2 vues (au cours des 30 derniers jours)
Yerzhigit Bapin
Yerzhigit Bapin le 13 Juil 2017
Hi all!
I have created a frequency table as follows:
A = [220 200 170 160 150 165 200 300 350 400 400 350 380 360 350 330 300 350 400 420 480 550 500 350];
B = tabulate(A);
Which results in 550x3 table, starting from 1 up to the maximum value of A, how do I limit it only to those 24 values?

Réponse acceptée

Jos (10584)
Jos (10584) le 13 Juil 2017
The help of TABULATE states: If the elements of X are non-negative integers, then the output includes 0 counts for any integers that are between 1 and max(X) but do not appear in X.
I do not know the reason behind this behaviour, but it does suggest the following solution: 1. add a negative value to the input 2. remove this entry after tabulation
A = [5 5 7 10 10 10]
B = tabulate([A(:) ; -Inf])
B = B(2:end,:)

Plus de réponses (0)

Catégories

En savoir plus sur Tables 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!

Translated by