MATLAB: Pre allocating vector for loop

pre-allocating

Can any one tell how to pre allocate c1?
thanks
for ii = 1:length(a11);
c1=cross(L1(1,:),a11(ii,:));
end

Best Answer

c1 = cell(numel(a11),1); % before loop use numel instead of length
c1{ii} = ... inside loop