Arreglos categóricos
categorical
es un tipo de dato que se utiliza para almacenar datos con valores provenientes de un conjunto finito de categorías discretas. Por ejemplo, la sintaxis C = categorical({'R','G','B','B','G','B'})
crea un arreglo categórico con seis elementos que pertenecen a las categorías R
, G
o B
.
Un arreglo categórico ofrece un almacenamiento eficiente y una manipulación conveniente de datos no numéricos, a la vez que mantiene nombres significativos para los valores de datos. Las categorías pueden tener un orden natural, pero esto no es obligatorio. Para obtener más información, consulte Create Categorical Arrays o vea Tablas y arreglos categóricos.
Funciones
Temas
- Create Categorical Arrays
This example shows how to create a categorical array.
- Access Data Using Categorical Arrays
Search, select, and delete elements from categorical arrays.
- Advantages of Using Categorical Arrays
Categorical arrays provide a natural representation of data, mathematical ordering of character vectors, and efficient memory usage.
- Core Functions Supporting Categorical Arrays
Many functions in MATLAB® operate on categorical arrays in much the same way that they operate on other arrays. A few of these functions might exhibit special behavior when operating on a categorical array.