Plot Categorical Data
This example shows how to plot data from a categorical array.Load Sample DataLoad sample data gathered from 100 patients.load patientswhosName Size Bytes Class AttributesAge 100x1 800 double
Diastolic 100x1 800 double
Gender 100x1 12212 cell
Height 100x1 800 double
LastName 100x1 12416 cell
Location 100x1 15008 cell
SelfAssessedHealthStatus 100x1 12340 cell
Smoker 100x1 100 logical
Systolic 100x1 800 double
Weight 100x1 800 doubleCreate Categorical Arrays from Cell Arrays of Character VectorsThe workspace variable, Location, is a cell array of character vectors that contains the
three unique medical facilities where patients were observed.To access and compare data more easily, convert Location to a categorical array.Location = categorical(Location);Summarize the categorical array.summary(Location)County General Hospital 39
St. Mary's Medical Center 24
VA Hospital 3739 patients were observed at County General Hospital, 24 at St. Mary's Medical Center,
and 37 at the VA Hospital.8 Categorical Arrays