Hello, suppose I've an item which will contain an unknown number of sub-items. Since the amount of sub-items that the array will have to store is unknown, it's size has to be dynamic. For that I will use cellarray, but I was wondering, which one of the two methods below would be optimal?
Create one array for each item:
Code:
item 1 => ["sub-item 1", "sub-item 1"]
item 2 => ["sub-item 2", "sub-item 2", "sub-item 2"]
item 3 => ["sub-item 3"]
Or store everything in a single array, would look like this:
Code:
["sub-item 1", "sub-item 1", "sub-item 2", "sub-item 2", "sub-item 2", "sub-item 3"]
"item 1" sub-items: 0-1
"item 2" sub-items: 2-4
"item 3" sub-items: 5
__________________