In Matlab, I need help in preallocating nested cell array and initializing it to zeros.
Problem description:
I have a numeric cell array, for example, called bn
. This array should be preallocatted in following way:
bn{1,1} = 0
bn{1,2}{1,1} = 0
bn{1,2}{1,2}{1,1} = 0
bn{1,2}{1,2}{1,2}{1,2} = 0
I also tried to describe my question with help of an image, assuming I have only three levels. Actually, I have around thirty.
Probably, with for
-loop this problem can be solved . But I don't have enough imagination :-(
So, please, help me experts!