///*********This is the MATLAB code for generating the basis vectors.****************///
///*********The set of all flux vectors v for equation 7 constitutes the null****************///
///*********space of the stoichiometric matrix S. The null space is an****************///
///*********underdetermined metabolic system. A set of basis vectors can be****************///
///*********selected to describe the null space of equation 7. The basis vectors are****************///
///*********generated using the null function available in MATLAB. Here the columns of B****************///
///*********are the basis vectors. The program segment that generates the basis vectors **********///
///*********is given below.****************///


load Stoichiomatrix.txt;
S=Stoichiomatrix;
clear Stoichiomatrix;
B=null(S);
row=size(B,1);
col=size(B,2);
fp=fopen('nullspace.txt','w');
fprintf(fp,'%d\t%d\n',row,col);
 for i=1:row,
         for j=1:col,
             fprintf(fp,'%f\t',B(i,j));
         end
     fprintf(fp,'\n');
end