MATLAB Programming Fundamentals - MathWorks

(やまだぃちぅ) #1

ans=5×3 table
Age Gender Smoker




38 'Male' true
43 'Male' false
38 'Female' false
40 'Female' false
49 'Female' false


head(T2,5)


ans=5×4 table
Height Weight Systolic Diastolic




71 176 124 93
69 163 109 77
64 131 125 83
67 133 117 75
64 119 122 80


Add Variables Concatenated from Another Table


Add variables to the table T by horizontally concatenating it with T2.


T = [T T2];


Display the first five rows of T.


head(T,5)


ans=5×7 table
Age Gender Smoker Height Weight Systolic Diastolic




38 'Male' true 71 176 124 93
43 'Male' false 69 163 109 77
38 'Female' false 64 131 125 83
40 'Female' false 67 133 117 75
49 'Female' false 64 119 122 80


The table T now has 7 variables and 100 rows.


Add, Delete, and Rearrange Table Variables
Free download pdf