Al momento, stai seguendo questo contributo
- Vedrai gli aggiornamenti nel tuo feed del contenuto seguito
- Potresti ricevere delle email a seconda delle tue preferenze per le comunicazioni
ENUMARRAY inherits from class double, but allows a user to index into the array using enumerated indices (i.e. strings) rather than numerical indices. Inputs are the array data, an MxNxPx... double array containing the data, and cell arrays of strings used to index into the data.
The created object can be referenced using strings or numeric indices.
Comments and reports of bugs are welcome.
Example:
data = repmat((1:10)',1,6) + repmat([10 20 30 40 50 60],10,1);
ind1 = {'one','two','three','four','five','six','seven','eight','nine','ten'};
ind2 = {'red','orange','yellow','green','blue','purple'};
EA = enumarray(data,ind1,ind2)
EA('one','red')
ans =
11
See the comments for more detailed examples. Note that due to the use of OOP, the earliest version of MATLAB for which this works is R2008a.
Cita come
Jen (2026). ENUMARRAY (https://it.mathworks.com/matlabcentral/fileexchange/21488-enumarray), MATLAB Central File Exchange. Recuperato .
Informazioni generali
- Versione 1.1.0.1 (4,34 KB)
Compatibilità della release di MATLAB
- Compatibile con qualsiasi release
Compatibilità della piattaforma
- Windows
- macOS
- Linux
