FUNCTION REFERENCE

categorical

Create an array of category codes and names.

Create an array of category codes and names.

Syntax

C = categorical(A); C = categorical(A,valueset,catnames,'Ordinal',true)

Numeric, logical, string, cellstr and character-row inputs are supported. Missing inputs become undefined; valueset fixes category order. Assignment to a nonordinal array can append categories.

Example

C = categorical([1 3 2],1:3,{'red','green','blue'}); cellstr(C)

Differences from MATLAB: two dimensions only; duplicate category names are rejected. Protected, summary, file persistence and categorical plots are not supported yet.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.