MATLAB Programming Fundamentals - MathWorks
large medium small A is a 10-by-1 categorical array. Display the categories of A. categories(A) ans = 3x1 cell array {'small' } ...
To add a new category for xlarge, use the addcats function. Since A is ordinal you must specify the order for the new category. ...
A = addcats(A,'xsmall','Before','small'); categories(A) ans = 5x1 cell array {'xsmall'} {'small' } {'medium'} {'large' } {'xlarg ...
xsmall small small The values from B are appended to the values from A. List the categories of C. categories(C) ans = 5x1 cell a ...
Advantages of Using Categorical Arrays In this section... “Natural Representation of Categorical Data” on page 8-43 “Mathematica ...
defined as character vectors, which can be costly to store and manipulate in a cell array of character vectors or char array. Ca ...
See Also categorical | categories Related Examples “Create Categorical Arrays” on page 8-2 “Convert Text in Table Variables to ...
Ordinal Categorical Arrays In this section... “Order of Categories” on page 8-46 “How to Create Ordinal Categorical Arrays” on p ...
Ordinal Categorical Array from a Cell Array of Character Vectors Create an ordinal categorical array, sizes, from a cell array o ...
sizes and sizes2 are equivalent categorical arrays with the same ordering of categories. Convert a Categorical Array from Nonord ...
See Also categorical | categories | isequal | isordinal Related Examples “Create Categorical Arrays” on page 8-2 “Convert Text ...
Core Functions Supporting Categorical Arrays Many functions in MATLAB operate on categorical arrays in much the same way that th ...
Tables “Create and Work with Tables” on page 9-2 “Add and Delete Table Rows” on page 9-14 “Add, Delete, and Rearrange Table Var ...
Create and Work with Tables This example shows how to create a table from workspace variables, work with table data, and write t ...
Populate a table with column-oriented variables that contain patient data. You can access and assign table variables by name. Wh ...
T.ID = randi(1e4,100,1); T(1:5,:) ans=5×5 table Gender Smoker Height Weight ID ________ ______ ______ ______ ____ 'Male' true 71 ...
Median 142.5 Max 202 ID: 100x1 double Values: Min 120 Median 5485.5 Max 9706 Return the size of the table. size(T) ans = 1×2 100 ...
Tnew=5×4 table Smoker Height Weight ID ______ ______ ______ ____ true 71 176 8148 false 69 163 9058 false 64 131 1270 false 67 1 ...
Select all the data for the patients with the last names 'Smith' and 'Johnson'. In this case, it is simpler to use the row names ...
ans=5×6 table Gender Smoker Height Weight ID BMI ________ ______ ______ ______ ____ ______ Smith 'Male' true 71 176 8148 24.547 ...
«
15
16
17
18
19
20
21
22
23
24
»
Free download pdf