The first input argument to pareto must be a vector. If a categorical array is a matrix or
multidimensional array, reshape it into a vector before calling countcats and pareto.
Create Scatter Plot
Convert the cell array of character vectors to a categorical array.
Gender = categorical(Gender);
Summarize the categorical array, Gender.
summary(Gender)
Female
53
Male
47
Gender is a 100-by-1 categorical array with two categories, Female and Male.
Use the categorical array, Gender, to access Weight and Height data for each gender separately.
X1 = Weight(Gender=='Female');
Y1 = Height(Gender=='Female');
X2 = Weight(Gender=='Male');
Y2 = Height(Gender=='Male');
X1 and Y1 are 53-by-1 numeric arrays containing data from the female patients.
8 Categorical Arrays
8-14
Précédent

- 318/1450

Suivant