Info

This question is closed. Reopen it to edit or answer.

Different values for data being stored and used by the code for same variable

1 view (last 30 days)
vref = xg(1:model.nReactions);
% x -> alpha(tk,EnzInd)
a_ = xg(model.nReactions+1:model.nReactions+model.nEnz*length(t));
for tk = 1:length(t)
a(tk,:) = a_(model.nEnz*(tk-1)+1:model.nEnz*tk);
end
% Alpha to reaction matrix i_th reaction times j_th alpha
a_mat = zeros(model.nEnz,model.nReactions);
for j = 1:model.nEnz
if j == model.nEnz
a_mat(j,model.EnzInd(j):end) = 1;
else
a_mat(j,model.EnzInd(j):model.EnzInd(j+1)-1) = 1;
end
end
A= []
% v_i(i,tk) = v_ref_i * a(j,tk) * b(tk)
for tk = 1:length(t)
aa = a(tk,:)*a_mat;
for ii = 1:model.nReactions
vi(ii,tk) = vref(ii)*aa(ii)*b(tk,ii);
A = [A; vref(ii) a(ii) b(tk,ii) vi(ii,tk)] %%values of vref displayed here are different than those stored in resultsCC1.vref
end
end
% v_e(i,tk) = v_i(j1,tk)*S(i,j1) + v_i(j2,tk)*S(i,j2) +...
ve = zeros(model.nMetabolites,length(t));
for tk = 1:length(t)
for ii = 1:model.nMetabolites
for jj = 1:model.nReactions
ve(ii,tk) = ve(ii,tk) + model.S(ii,jj)*vi(jj,tk);
end
end
end
%Normalize a
a = a./repmat(a(1,:),size(a,1),1);
%% Save Results in a structure
resultsCC1.a = a;
resultsCC1.vref = vref;
resultsCC1.b = b;
resultsCC1.vi = vi';
resultsCC1.ve = ve';
resultsCC1.ssr = fg;

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!