function val=DEBACKUPFILE(fid,CR,D,F,Generations,NP,V1,V2,V3,additionalParameters,costFunctionHandle,bounds,costValues,findValues,globalErrorHistory,i,indexOfBest,individuals,j,l,min,optimizedFunctionName,tmpcostValues,tmpindividuals)
val = 0;

% Zapsani casti textu do souboru
fprintf(fid, ['%%Backup file was created at ',datestr(now),'\n']);
fprintf(fid, '%%-----------------------------------------------\n');
fprintf(fid, '%%DE BACKUP FILE\n');
fprintf(fid, '%%-----------------------------------------------\n\n');
fprintf(fid, '%%Ulozeni parametru je nasledovne!\n');
fprintf(fid, ['CR=[',num2str(CR),'];\n']);
fprintf(fid, ['D=[',num2str(D),'];\n']);
fprintf(fid, ['F=[',num2str(F),'];\n']);
fprintf(fid, ['Generations=[',num2str(Generations),'];\n']);
fprintf(fid, ['NP=[',num2str(NP),'];\n']);
fprintf(fid, ['V1=[',num2str(V1),'];\n']);
fprintf(fid, ['V2=[',num2str(V2),'];\n']);
fprintf(fid, ['V3=[',num2str(V3),'];\n']);
fprintf(fid, ['additionalParameters=[',num2str(additionalParameters),'];\n']);
fprintf(fid, 'bounds = [\n');
for i=1:length(bounds(:,1))
    fprintf(fid, ['',num2str(bounds(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['costFunctionHandle=[@',costFunctionHandle,'];\n']);
fprintf(fid, 'costValues = [\n');
for i=1:length(costValues(:,1))
    fprintf(fid, ['',num2str(costValues(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['findValue=[',num2str(findValues),'];\n']);
fprintf(fid, 'globalErrorHistory = [\n');
for i=1:length(globalErrorHistory(:,1))
    fprintf(fid, ['',num2str(globalErrorHistory(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['i = [',num2str(i),'];\n']);
fprintf(fid, ['indexOfBest = [',num2str(indexOfBest),'];\n']);
fprintf(fid, 'individuals = [\n');
for i=1:length(individuals(:,1))
    fprintf(fid, ['',num2str(individuals(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['j = [',num2str(j),'];\n']);
fprintf(fid, ['l = [',num2str(l),'];\n']);
fprintf(fid, ['min = [',num2str(min),'];\n']);
fprintf(fid, ['optimizedFunctionName = [''',optimizedFunctionName,'''];\n']);
fprintf(fid, ['tmpcostValues = [',num2str(tmpcostValues),'];\n']);
fprintf(fid, 'tmpindividuals = [\n');
for i=1:length(tmpindividuals(:,1))
    fprintf(fid, ['',num2str(tmpindividuals(i,:)),';\n']);
end
fprintf(fid, '];\n');



fprintf(fid, '%%-----------------------------------------------\n');
val = 1;
end