What is the best data structure for mapping a key to an array of values in MATLAB?
I am facing an issue with which data structure to use and when. My use case involves unique keys, each of which will be mapped to an array of values.
‘UniqueKey1’ -> [‘Value1’, ‘Value2’, 1, 2, true];
‘UniqueKey2’ -> [‘Value2’, ‘Value3’, 2, 5, false];
‘UniqueKey3’ -> [‘Value3’, ‘Value4’, 5, 5, true];
I know Struct could be one of the options, but I am worried about the performance when the data size is large (more than 100 rows). Can someone recommend a better alternative in my case?I am facing an issue with which data structure to use and when. My use case involves unique keys, each of which will be mapped to an array of values.
‘UniqueKey1’ -> [‘Value1’, ‘Value2’, 1, 2, true];
‘UniqueKey2’ -> [‘Value2’, ‘Value3’, 2, 5, false];
‘UniqueKey3’ -> [‘Value3’, ‘Value4’, 5, 5, true];
I know Struct could be one of the options, but I am worried about the performance when the data size is large (more than 100 rows). Can someone recommend a better alternative in my case? I am facing an issue with which data structure to use and when. My use case involves unique keys, each of which will be mapped to an array of values.
‘UniqueKey1’ -> [‘Value1’, ‘Value2’, 1, 2, true];
‘UniqueKey2’ -> [‘Value2’, ‘Value3’, 2, 5, false];
‘UniqueKey3’ -> [‘Value3’, ‘Value4’, 5, 5, true];
I know Struct could be one of the options, but I am worried about the performance when the data size is large (more than 100 rows). Can someone recommend a better alternative in my case? matlab, structures, arrays, struct MATLAB Answers — New Questions