[g, gN] = grp2idx(s)
[g, gN, gL] = grp2idx(s)
grp2idx converts a grouping variable to numeric group indices.
gN is a cell array of group names. gL contains the group levels in a type matching the input when possible. Missing group values produce NaN indices.
s = {'red', 'blue', 'red', ''};
[g, gN, gL] = grp2idx(s)
| Version | Description |
|---|---|
| 2.0.0 | initial version |