I am trying to pre-allocate a uniformly nested structure array.
I'm currently using for loops to allocate values to the array, but I understand that this is slow if the array has not been pre-allocated.
The structure I am trying to achieve is generated by the following code:
aLength = 10;
bLength = 20;
a = struct('b',{});
b = struct('c',{0},'d',{0});
for i = 1:aLength
for j = 1:bLength
a(i).b(j) = b;
end
end
Where the zero values will be replaced later in a for loop.