function [string,ixc]=updatethickness(md,ixc,dvar)

string=sprintf('\n\t[epart,npart]=MeshPartition(md,%d);\n',md.npart);
string=[string sprintf('\n')];
for j=1:length(dvar)
	if strncmpi(dvar(j).descriptor,'thickness',9)
        ixc=ixc+1;
		ithick=sscanf(dvar(j).descriptor(10:end),'%d');
        if strcmpi(md.analysis_driver,'matlab')
            string=[string sprintf('\tthicki(%d,1)=Dakota.xC(%d);\n',ithick,ixc)];
        else
            string=[string sprintf('\tthicki(%d,1)={%s};\n',ithick,dvar(j).descriptor)];
        end
	end
end
string=[string sprintf('\tmd.thickness =md.thickness .*thicki(npart);\n')];
string=[string sprintf('\tclear thicki\n')];
string=[string sprintf('\tmd.surface   =md.bed+md.thickness;\n')];
string=[string sprintf('\tclear npart epart\n')];
string=[string sprintf('\n')];

end
