numD = length(D);
F = zeros(0, length(D));
for i = 1 : numD
stuff and then
Frows = size(F,1);
numFeat = length(stFeatures);
if Frows < numFeat
%new file is bigger than anything so far, extend all existing rows with 1
F(Frows+1:numFeat, :) = 1;
elseif numFeat < Frows
%new file is smaller than what we have seen so far, extend it with 1
stFeatures(numFeat+1:Frows) = 1;
end
F(:, i) = stFeatures;
end