MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
When using dot indexing, you must specify a single variable to access. For a single
variable name, use T.var. For a single variable index, specified as a positive integer, use
T.(varindex).

Create Table from Subset of Larger Table


This example shows how to create a table from a subset of a larger table.

Load Sample Data

Load the sample patients data and create a table. Use the unique identifiers in LastName
as row names.

load patients

patients = table(Age,Gender,Height,Weight,Smoker,...
'RowNames',LastName);

The table, patients, contains 100 rows and 5 variables.

View the data type, description, units, and other descriptive statistics for each variable by
using summary to summarize the table.

summary(patients)

Variables:

Age: 100x1 double

Values:

Min 25
Median 39
Max 50

Gender: 100x1 cell array of character vectors

Height: 100x1 double

Values:

Min 60
Median 67
Max 72

9 Tables

Free download pdf