MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1
T.ID = randi(1e4,100,1);
T(1:5,:)

ans=5×5 table
Gender Smoker Height Weight ID
________ ______ ______ ______ ____

'Male' true 71 176 8148
'Male' false 69 163 9058
'Female' false 64 131 1270
'Female' false 67 133 9134
'Female' false 64 119 6324

All the variables you assign to a table must have the same number of rows.

View the data type, description, units, and other descriptive statistics for each variable by
creating a table summary using the summary function.

summary(T)

Variables:

Gender: 100x1 cell array of character vectors

Smoker: 100x1 logical

Values:

True 34
False 66

Height: 100x1 double

Values:

Min 60
Median 67
Max 72

Weight: 100x1 double

Values:

Min 111

9 Tables

Free download pdf