La traducción de esta página está obsoleta. Haga clic aquí para ver la última versión en inglés.
Estructuras
Un arreglo de estructura es un tipo de dato que agrupa datos relacionados mediante contenedores de datos llamados campos. Cada campo puede contener cualquier tipo de datos. Para acceder a los datos de una estructura, es posible usar una notación punto con el formato structName.fieldName
. Para obtener más información, consulte Arreglos de estructuras o vea Introducción a estructuras y arreglos de celdas.
Funciones
struct | Arreglo de estructuras |
fieldnames | Field names of structure, or public fields of Java or Microsoft COM object |
getfield | Field of structure array |
isfield | Determine if input is structure array field |
isstruct | Determine if input is structure array |
orderfields | Order fields of structure array |
rmfield | Remove fields from structure |
setfield | Assign value to structure array field |
arrayfun | Apply function to each element of array |
structfun | Apply function to each field of scalar structure |
table2struct | Convert table to structure array |
struct2table | Convert structure array to table |
cell2struct | Convert cell array to structure array |
struct2cell | Convert structure to cell array |
Temas
- Arreglos de estructuras
Cree un arreglo de estructuras y almacene datos en sus campos. Acceda al contenido por su nombre con la indexación de arreglos y la notación de puntos.
- Generar nombres de campo desde variables
Determine dinámicamente un nombre de campo de estructura en tiempo de ejecución desde una variable o expresión.
- Ways to Organize Data in Structure Arrays
Consider ease of data access and system memory constraints when determining how to organize the data in a structure array.
- Memory Requirements for Structure Array
Structure arrays do not require contiguous memory, but their fields do. Instead of incrementally increasing the number of fields or number of elements in a field, preallocate memory for fields containing very large arrays.
- Cell vs. Structure Arrays
This example compares cell and structure arrays and shows how to store data in each type of array. Cell and structure arrays enable you to store data of different types and sizes.