function St=mkstruct(St0,k)
% function St=mkstruct(St0,k)
% Adds the structure for the kth compound to the structure St0
% getting the field names and making them global in mkstruct
flds=fieldnames(St0);
[nrowf,ncolf]=size(flds);
globs='global ';
for kf=1:nrowf
   globs=[globs,flds{kf,1},' '];
end
eval(globs)
[nrowS,ncolS]=size(St0);
St=St0;
newc=num2str(ncolS+1);
for kf=1:nrowf
    eval(['St(1,',newc,').',flds{kf,1},'=',flds{kf,1},'(k,:);'])
end
