B = removecats(A)
B = removecats(A, oldCategories)
| Parameter | Description |
|---|---|
| A | Input categorical array. |
| oldCategories | Categories to remove. If omitted, unused categories are removed. |
| Parameter | Description |
|---|---|
| B | Categorical array with a reduced category list. |
removecats removes categories from the category list.
Elements that belonged to removed categories become undefined. When oldCategories is omitted, only unused categories are removed.
A = categorical({'red','blue'}, {'red','blue','green'}); B = removecats(A, 'green'); categories(B)
A = categorical({'red','blue','green'}); B = removecats(A, 'green'); isundefined(B)
| Version | Description |
|---|---|
| 2.0.0 | initial version |