Strutture
Un array di strutture è un tipo di dati che racchiude dati correlati mediante contenitori di dati chiamati campi. Ciascun campo può contenere qualsiasi tipo di dati. Per accedere ai dati di una struttura si utilizza la notazione a punti nella forma structName.fieldName
. Per maggiori informazioni, vedere Structure Arrays o guardare Introducing Structures and Cell Arrays Introduzione alle strutture e agli array di celle.
Funzioni
struct | Array di struttura |
fieldnames | Nomi dei campi di strutture o campi pubblici di oggetti Java o Microsoft COM |
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 | Rimuovere i campi dalla struttura |
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 |
Argomenti
- Structure Arrays
Create a structure array and store data in its fields. Access the contents by name using array indexing and dot notation.
- Generazione dei nomi dei campi dalle variabili
Determinare dinamicamente il nome di un campo di una struttura in fase di runtime da una variabile o da un'espressione.
- 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.