The nominal and ordinal array data types might be removed in a future release. To represent ordered and unordered discrete, nonnumeric data, use the MATLAB® categorical data type instead.
I = subsindex(A)
I = subsindex(A) is called for the syntax 'X(A)' when A is a categorical array and X is one of the built-in types (most commonly 'double'). subsindex returns the internal categorical level codes of A converted to zero-based integer indices. subsindex is invoked separately on all the subscripts in an expression such as X(A,B).
load fisheriris a = ordinal(species,,unique(species)); colmeans = grpstats(meas,a,@mean); residuals = meas - colmeans(a,:);