printSolutionGEM

PURPOSE ^

printSolution displays the solution for growthExpMatch iterations

SYNOPSIS ^

function printSolutionGEM(MatricesSUX, solution, logFile, itNum)

DESCRIPTION ^

printSolution displays the solution for growthExpMatch iterations

 11-10-07 IT

 Modified 11/18/09: Joseph Kang

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function printSolutionGEM(MatricesSUX, solution, logFile, itNum)
0002 %printSolution displays the solution for growthExpMatch iterations
0003 %
0004 % 11-10-07 IT
0005 %
0006 % Modified 11/18/09: Joseph Kang
0007 
0008 if nargin >2
0009     save([logFile '_solution_' num2str(itNum)], 'solution');
0010     if ~strcmp(logFile(end-3:end),'.txt'), logFile = [logFile '.txt']; end
0011     if (itNum ==1)
0012         fid = fopen(logFile,'w');
0013     else
0014         fid = fopen(logFile,'a');
0015     end
0016     fprintf(fid,'%s','Iteration:');
0017     fprintf(fid,'\t');
0018     fprintf(fid,'%d',itNum);
0019     fprintf(fid,'\n');
0020 else
0021     fid=1;
0022 end
0023 
0024 fprintf(fid, '%s','Objective Value:');
0025 fprintf(fid,'\t');
0026 fprintf(fid,'%d',solution.obj);
0027 fprintf(fid,'\n');
0028 fprintf(fid,'\n');
0029 % prints only non-zero results
0030 for i=1:length(solution.cont)
0031     if (solution.cont(i)~= 0)  && MatricesSUX.MatrixPart(i)~= 1
0032         fprintf(fid,'%d',i);
0033         fprintf(fid,'\t');
0034         fprintf(fid,'%s', MatricesSUX.rxns{i});
0035         fprintf(fid,'\t');
0036         fprintf(fid,'%d',solution.cont(i));
0037         fprintf(fid,'\n');
0038     end
0039 end
0040 
0041 fprintf(fid,'\n');
0042 if nargin >2
0043     fclose(fid);
0044 end

Generated on Thu 21-Jun-2012 15:39:23 by m2html © 2003