| Statistics Toolbox™ | ![]() |
labels = getlabels(A)
labels = getlabels(A) returns the labels of the levels in the categorical array A as a cell array of strings labels. For ordinal A, the labels are returned in the order of the levels.
Display levels in a nominal and an ordinal array:
standings = nominal({'Leafs','Canadiens','Bruins'});
getlabels(standings)
ans =
'Bruins' 'Canadiens' 'Leafs'
standings = ordinal(1:3,{'Leafs','Canadiens','Bruins'});
getlabels(standings)
ans =
'Leafs' 'Canadiens' 'Bruins'Display age groups containing data in hospital.mat:
load hospital
edges = 0:10:100;
labels = strcat(num2str((0:10:90)','%d'),{'s'});
AgeGroup = ordinal(hospital.Age,labels,[],edges);
AgeGroup = droplevels(AgeGroup);
getlabels(AgeGroup)
ans =
'20s' '30s' '40s' '50s'![]() | get | geocdf | ![]() |
| © 1984-2008- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |