MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

histogram(Age(Gender=='Female')) plots the age data for the 53 female patients.


Delete Data from a Particular Category


You can use logical operators to include or exclude data from particular categories.
Delete all patients observed at VA Hospital from the workspace variables, Age and
Location.


Age = Age(Location~='VA Hospital');
Location = Location(Location~='VA Hospital');


Now, Age is a 63-by-1 numeric array, and Location is a 63-by-1 categorical array.


List the categories of Location, as well as the number of elements in each category.


Access Data Using Categorical Arrays
Free download pdf