A = rand(10,1);
B = rand(10,1);
C = rand(10,1);
IDs = [1:10]';
cutlery = {'knives','spoons','forks','spoonForkDelta'};
foods = {'ham','eggs','chips'};
% Bad Structure. Don't be like this one.
for iB = 1:length(IDs)
badStruct.data(iB).IDs = IDs(iB);
badStruct.data(iB).A = A(iB);
badStruct.data(iB).B = B(iB);
badStruct.data(iB).C = C(iB);
end
badStruct.kitchen.cutlery = cutlery;
badStruct.kitchen.foods = foods;
% Nice Structure. Be like this one.
niceStruct.data = table(A,B,C);
niceStruct.IDs = IDs;
niceStruct.kitchen.cutlery = cutlery;
niceStruct.kitchen.foods = foods;
% ok structure - at least it's straightforward to index.
okStruct.data.A = A;
okStruct.data.B = B;
okStruct.data.C = C;
okStruct.data.IDs = IDs;
okStruct.kitchen.cutlery = cutlery;
okStruct.kitchen.foods = foods;