function val=SOMABACKUPFILE(fid,DL,PRTVector,TL,additionalParameters,bounds,...
costFunctionHandle,costValues,dim,findValue,globalErrorHistory,...
go,i,indexOfLeader,individuals,j,leaderPosition,...
mig,migCheck,migrations,min,minDiv,optimizedFunctionName,pathLength,...
popSize,prt,prtVectorContainOnlyZeros,startPositionOfIndividual,step,...
t,tmpCostValue,tmpIndividual,vypocet)
val = 0;

% Zapsani casti textu do souboru
fprintf(fid, ['%%Backup file was created at ',datestr(now),'\n']);
fprintf(fid, '%%-----------------------------------------------\n');
fprintf(fid, '%%SOMA BACKUP FILE\n');
fprintf(fid, '%%-----------------------------------------------\n\n');
fprintf(fid, '%%Ulozeni parametru je nasledovne!\n');
fprintf(fid, ['DL=[',num2str(DL),'];\n']);
fprintf(fid, ['PRTVector=[',num2str(PRTVector),'];\n']);
fprintf(fid, ['TL=[',num2str(TL),'];\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, ['dim=[',num2str(dim),'];\n']);
fprintf(fid, ['findValue=[',num2str(findValue),'];\n']);
fprintf(fid, 'globalErrorHistory = [\n');
for i=1:length(globalErrorHistory(:,1))
    fprintf(fid, ['',num2str(globalErrorHistory(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['go = [',num2str(go),'];\n']);
fprintf(fid, ['i = [',num2str(i),'];\n']);
fprintf(fid, ['indexOfLeader = [',num2str(indexOfLeader),'];\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, 'leaderPosition = [\n');
for i=1:length(leaderPosition(:,1))
    fprintf(fid, ['',num2str(leaderPosition(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['mig=[',num2str(mig),'];\n']);
fprintf(fid, ['migCheck=[',num2str(migCheck),'];\n']);
fprintf(fid, ['migrations=[',num2str(migrations),'];\n']);
fprintf(fid, ['min=[',num2str(min),'];\n']);
fprintf(fid, ['minDiv=[',num2str(minDiv),'];\n']);
fprintf(fid, ['optimizedFunctionName = [''',optimizedFunctionName,'''];\n']);
fprintf(fid, ['pathLength=[',num2str(pathLength),'];\n']);
fprintf(fid, ['popSize=[',num2str(popSize),'];\n']);
fprintf(fid, ['prt=[',num2str(prt),'];\n']);
fprintf(fid, ['prtVectorContainOnlyZeros=[',num2str(prtVectorContainOnlyZeros),'];\n']);
fprintf(fid, 'startPositionOfIndividual = [\n');
for i=1:length(startPositionOfIndividual(:,1))
    fprintf(fid, ['',num2str(startPositionOfIndividual(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['step=[',num2str(step),'];\n']);
fprintf(fid, ['t=[',num2str(t),'];\n']);
fprintf(fid, ['tmpCostValue=[',num2str(tmpCostValue),'];\n']);
fprintf(fid, 'tmpIndividual = [\n');
for i=1:length(tmpIndividual(:,1))
    fprintf(fid, ['',num2str(tmpIndividual(i,:)),';\n']);
end
fprintf(fid, '];\n');
fprintf(fid, ['vypocet=[',num2str(vypocet),'];\n']);

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