I am trying to initialize an empty array which itself contains 5 empty arrays. But matlab seems to just create a simple empty array variable instead. Following are the two syntaxes I have tried. Any ideas if it is possible in matlab?
bins = [ []; []; []; []; [] ];
bins = repmat([], 5, 1)
MATLAB only has matrices, i.e. (potentially multidimensional) arrays of numerical types (or characters or logical values). To group other structures in one variable, try a cell array, e.g.
You then have to access elements of the outer array with curly brackets, e.g.
bins{2}instead ofbins(2).