Hello, how can i pre-define an array/struct of structs? Motivation. I was dynamically creating an array that grew with every iteration using the sample code below:
ultimate_result = ;
items(i).name = item_name;
items(i).size = item_size;
items(i).results = item_result;
ultimate_result = [ultimate_result items(i)];
now some of you have already predicted, I run out of memory (which is actually the main problem and reason i need this) as the item size grows even with my 32gb or ram. I know before hand the number of items i will need to process.
I have tried something like
ultimate_result(2000) = struct;
but MATLAB gives the following error.
Unable to perform assignment because the indices on the left side are not compatible with the size of the right side.
Any suggestions to help get rid of the problem will be greatly appreciated. Of course i have tried increasing matlab priority in the task manager in vain,
Am using windows 10, Matlab 2020a, with about 32gb ram.