# Generated Code

The following is matlab code generated by the CellML API from this CellML file. (Back to language selection)

The raw code is available.

```function [VOI, STATES, ALGEBRAIC, CONSTANTS] = mainFunction()
% This is the "main function".  In Matlab, things work best if you rename this function to match the filename.
[VOI, STATES, ALGEBRAIC, CONSTANTS] = solveModel();
end

function [algebraicVariableCount] = getAlgebraicVariableCount()
% Used later when setting a global variable with the number of algebraic variables.
% Note: This is not the "main method".
algebraicVariableCount =0;
end
% There are a total of 19 entries in each of the rate and state variable arrays.
% There are a total of 63 entries in the constant variable array.
%

function [VOI, STATES, ALGEBRAIC, CONSTANTS] = solveModel()
% Create ALGEBRAIC of correct size
global algebraicVariableCount;  algebraicVariableCount = getAlgebraicVariableCount();
% Initialise constants and state variables
[INIT_STATES, CONSTANTS] = initConsts;

% Set timespan to solve over
tspan = [0, 10];

% Set numerical accuracy options for ODE solver
options = odeset('RelTol', 1e-06, 'AbsTol', 1e-06, 'MaxStep', 1);

% Solve model with ODE solver
[VOI, STATES] = ode15s(@(VOI, STATES)computeRates(VOI, STATES, CONSTANTS), tspan, INIT_STATES, options);

% Compute algebraic variables
[RATES, ALGEBRAIC] = computeRates(VOI, STATES, CONSTANTS);
ALGEBRAIC = computeAlgebraic(ALGEBRAIC, CONSTANTS, STATES, VOI);

% Plot state variables against variable of integration
[LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends();
figure();
plot(VOI, STATES);
xlabel(LEGEND_VOI);
l = legend(LEGEND_STATES);
set(l,'Interpreter','none');
end

function [LEGEND_STATES, LEGEND_ALGEBRAIC, LEGEND_VOI, LEGEND_CONSTANTS] = createLegends()
LEGEND_STATES = ''; LEGEND_ALGEBRAIC = ''; LEGEND_VOI = ''; LEGEND_CONSTANTS = '';
LEGEND_VOI = strpad('time in component environment (hour)');
LEGEND_STATES(:,1) = strpad('MP in component MP (nanomolar)');
LEGEND_CONSTANTS(:,1) = strpad('vsP in component MP (flux)');
LEGEND_CONSTANTS(:,2) = strpad('vmP in component MP (flux)');
LEGEND_CONSTANTS(:,3) = strpad('kdmp in component MP (first_order_rate_constant)');
LEGEND_CONSTANTS(:,4) = strpad('KAP in component MP (nanomolar)');
LEGEND_CONSTANTS(:,5) = strpad('KmP in component MP (nanomolar)');
LEGEND_CONSTANTS(:,6) = strpad('n in component model_parameters (dimensionless)');
LEGEND_STATES(:,2) = strpad('BN in component BN (nanomolar)');
LEGEND_STATES(:,3) = strpad('MC in component MC (nanomolar)');
LEGEND_CONSTANTS(:,7) = strpad('vsC in component MC (flux)');
LEGEND_CONSTANTS(:,8) = strpad('vmC in component MC (flux)');
LEGEND_CONSTANTS(:,9) = strpad('kdmc in component MC (first_order_rate_constant)');
LEGEND_CONSTANTS(:,10) = strpad('KAC in component MC (nanomolar)');
LEGEND_CONSTANTS(:,11) = strpad('KmC in component MC (nanomolar)');
LEGEND_STATES(:,4) = strpad('MB in component MB (nanomolar)');
LEGEND_CONSTANTS(:,12) = strpad('vsB in component MB (flux)');
LEGEND_CONSTANTS(:,13) = strpad('vmB in component MB (flux)');
LEGEND_CONSTANTS(:,14) = strpad('kdmb in component MB (first_order_rate_constant)');
LEGEND_CONSTANTS(:,15) = strpad('KIB in component MB (nanomolar)');
LEGEND_CONSTANTS(:,16) = strpad('KmB in component MB (nanomolar)');
LEGEND_CONSTANTS(:,17) = strpad('m in component model_parameters (dimensionless)');
LEGEND_STATES(:,5) = strpad('RN in component RN (nanomolar)');
LEGEND_STATES(:,6) = strpad('MR in component MR (nanomolar)');
LEGEND_CONSTANTS(:,18) = strpad('vsR in component MR (flux)');
LEGEND_CONSTANTS(:,19) = strpad('vmR in component MR (flux)');
LEGEND_CONSTANTS(:,20) = strpad('kdmr in component MR (first_order_rate_constant)');
LEGEND_CONSTANTS(:,21) = strpad('KAR in component MR (nanomolar)');
LEGEND_CONSTANTS(:,22) = strpad('KmR in component MR (nanomolar)');
LEGEND_CONSTANTS(:,23) = strpad('h in component model_parameters (dimensionless)');
LEGEND_STATES(:,7) = strpad('PC in component PC (nanomolar)');
LEGEND_CONSTANTS(:,24) = strpad('ksP in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,25) = strpad('Kp in component model_parameters (nanomolar)');
LEGEND_CONSTANTS(:,26) = strpad('Kdp in component model_parameters (nanomolar)');
LEGEND_CONSTANTS(:,27) = strpad('k3 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,28) = strpad('k4 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,29) = strpad('kdn in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,30) = strpad('V1P in component model_parameters (flux)');
LEGEND_CONSTANTS(:,31) = strpad('V2P in component model_parameters (flux)');
LEGEND_STATES(:,8) = strpad('PCP in component PCP (nanomolar)');
LEGEND_STATES(:,9) = strpad('PCC in component PCC (nanomolar)');
LEGEND_STATES(:,10) = strpad('CC in component CC (nanomolar)');
LEGEND_CONSTANTS(:,32) = strpad('ksC in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,33) = strpad('kdnc in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,34) = strpad('V1C in component model_parameters (flux)');
LEGEND_CONSTANTS(:,35) = strpad('V2C in component model_parameters (flux)');
LEGEND_STATES(:,11) = strpad('CCP in component CCP (nanomolar)');
LEGEND_STATES(:,12) = strpad('RC in component RC (nanomolar)');
LEGEND_CONSTANTS(:,36) = strpad('ksR in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,37) = strpad('Kd in component model_parameters (nanomolar)');
LEGEND_CONSTANTS(:,38) = strpad('k9 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,39) = strpad('k10 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,40) = strpad('vdRC in component model_parameters (flux)');
LEGEND_CONSTANTS(:,41) = strpad('vdPC in component model_parameters (flux)');
LEGEND_CONSTANTS(:,42) = strpad('vdCC in component model_parameters (flux)');
LEGEND_CONSTANTS(:,43) = strpad('k1 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,44) = strpad('k2 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,45) = strpad('V1PC in component model_parameters (flux)');
LEGEND_CONSTANTS(:,46) = strpad('V2PC in component model_parameters (flux)');
LEGEND_STATES(:,13) = strpad('PCCP in component PCCP (nanomolar)');
LEGEND_STATES(:,14) = strpad('PCN in component PCN (nanomolar)');
LEGEND_CONSTANTS(:,47) = strpad('k7 in component model_parameters (second_order_rate_constant)');
LEGEND_CONSTANTS(:,48) = strpad('k8 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,49) = strpad('V3PC in component model_parameters (flux)');
LEGEND_CONSTANTS(:,50) = strpad('V4PC in component model_parameters (flux)');
LEGEND_STATES(:,15) = strpad('PCNP in component PCNP (nanomolar)');
LEGEND_STATES(:,16) = strpad('IN in component IN (nanomolar)');
LEGEND_CONSTANTS(:,51) = strpad('vdRN in component model_parameters (flux)');
LEGEND_CONSTANTS(:,52) = strpad('vdPCC in component model_parameters (flux)');
LEGEND_CONSTANTS(:,53) = strpad('vdPCN in component model_parameters (flux)');
LEGEND_STATES(:,17) = strpad('BC in component BC (nanomolar)');
LEGEND_CONSTANTS(:,54) = strpad('ksB in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,55) = strpad('k5 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,56) = strpad('k6 in component model_parameters (first_order_rate_constant)');
LEGEND_CONSTANTS(:,57) = strpad('V1B in component model_parameters (flux)');
LEGEND_CONSTANTS(:,58) = strpad('V2B in component model_parameters (flux)');
LEGEND_STATES(:,18) = strpad('BCP in component BCP (nanomolar)');
LEGEND_CONSTANTS(:,59) = strpad('vdBC in component model_parameters (flux)');
LEGEND_CONSTANTS(:,60) = strpad('V3B in component model_parameters (flux)');
LEGEND_CONSTANTS(:,61) = strpad('V4B in component model_parameters (flux)');
LEGEND_STATES(:,19) = strpad('BNP in component BNP (nanomolar)');
LEGEND_CONSTANTS(:,62) = strpad('vdBN in component model_parameters (flux)');
LEGEND_CONSTANTS(:,63) = strpad('vdIN in component model_parameters (flux)');
LEGEND_RATES(:,1) = strpad('d/dt MP in component MP (nanomolar)');
LEGEND_RATES(:,3) = strpad('d/dt MC in component MC (nanomolar)');
LEGEND_RATES(:,4) = strpad('d/dt MB in component MB (nanomolar)');
LEGEND_RATES(:,6) = strpad('d/dt MR in component MR (nanomolar)');
LEGEND_RATES(:,7) = strpad('d/dt PC in component PC (nanomolar)');
LEGEND_RATES(:,10) = strpad('d/dt CC in component CC (nanomolar)');
LEGEND_RATES(:,12) = strpad('d/dt RC in component RC (nanomolar)');
LEGEND_RATES(:,8) = strpad('d/dt PCP in component PCP (nanomolar)');
LEGEND_RATES(:,11) = strpad('d/dt CCP in component CCP (nanomolar)');
LEGEND_RATES(:,9) = strpad('d/dt PCC in component PCC (nanomolar)');
LEGEND_RATES(:,14) = strpad('d/dt PCN in component PCN (nanomolar)');
LEGEND_RATES(:,5) = strpad('d/dt RN in component RN (nanomolar)');
LEGEND_RATES(:,13) = strpad('d/dt PCCP in component PCCP (nanomolar)');
LEGEND_RATES(:,15) = strpad('d/dt PCNP in component PCNP (nanomolar)');
LEGEND_RATES(:,17) = strpad('d/dt BC in component BC (nanomolar)');
LEGEND_RATES(:,18) = strpad('d/dt BCP in component BCP (nanomolar)');
LEGEND_RATES(:,2) = strpad('d/dt BN in component BN (nanomolar)');
LEGEND_RATES(:,19) = strpad('d/dt BNP in component BNP (nanomolar)');
LEGEND_RATES(:,16) = strpad('d/dt IN in component IN (nanomolar)');
LEGEND_STATES  = LEGEND_STATES';
LEGEND_ALGEBRAIC = LEGEND_ALGEBRAIC';
LEGEND_RATES = LEGEND_RATES';
LEGEND_CONSTANTS = LEGEND_CONSTANTS';
end

function [STATES, CONSTANTS] = initConsts()
VOI = 0; CONSTANTS = []; STATES = []; ALGEBRAIC = [];
STATES(:,1) = 0.1;
CONSTANTS(:,1) = 2.4;
CONSTANTS(:,2) = 2.2;
CONSTANTS(:,3) = 0.02;
CONSTANTS(:,4) = 0.6;
CONSTANTS(:,5) = 0.3;
CONSTANTS(:,6) = 2.0;
STATES(:,2) = 0.1;
STATES(:,3) = 1.2;
CONSTANTS(:,7) = 2.2;
CONSTANTS(:,8) = 2.0;
CONSTANTS(:,9) = 0.02;
CONSTANTS(:,10) = 0.6;
CONSTANTS(:,11) = 0.4;
STATES(:,4) = 9;
CONSTANTS(:,12) = 1.8;
CONSTANTS(:,13) = 1.3;
CONSTANTS(:,14) = 0.02;
CONSTANTS(:,15) = 2.2;
CONSTANTS(:,16) = 0.4;
CONSTANTS(:,17) = 2.0;
STATES(:,5) = 0.1;
STATES(:,6) = 1.5;
CONSTANTS(:,18) = 1.6;
CONSTANTS(:,19) = 1.6;
CONSTANTS(:,20) = 0.02;
CONSTANTS(:,21) = 0.6;
CONSTANTS(:,22) = 0.4;
CONSTANTS(:,23) = 2.0;
STATES(:,7) = 0.1;
CONSTANTS(:,24) = 1.2;
CONSTANTS(:,25) = 1.006;
CONSTANTS(:,26) = 0.1;
CONSTANTS(:,27) = 0.8;
CONSTANTS(:,28) = 0.4;
CONSTANTS(:,29) = 0.02;
CONSTANTS(:,30) = 9.6;
CONSTANTS(:,31) = 0.6;
STATES(:,8) = 0.1;
STATES(:,9) = 0.1;
STATES(:,10) = 0.1;
CONSTANTS(:,32) = 3.2;
CONSTANTS(:,33) = 0.02;
CONSTANTS(:,34) = 1.2;
CONSTANTS(:,35) = 0.2;
STATES(:,11) = 0.1;
STATES(:,12) = 0.1;
CONSTANTS(:,36) = 1.7;
CONSTANTS(:,37) = 0.3;
CONSTANTS(:,38) = 0.8;
CONSTANTS(:,39) = 0.4;
CONSTANTS(:,40) = 4.4;
CONSTANTS(:,41) = 3.4;
CONSTANTS(:,42) = 1.4;
CONSTANTS(:,43) = 0.8;
CONSTANTS(:,44) = 0.4;
CONSTANTS(:,45) = 2.4;
CONSTANTS(:,46) = 0.2;
STATES(:,13) = 0.1;
STATES(:,14) = 0.1;
CONSTANTS(:,47) = 1.0;
CONSTANTS(:,48) = 0.2;
CONSTANTS(:,49) = 2.4;
CONSTANTS(:,50) = 0.2;
STATES(:,15) = 0.1;
STATES(:,16) = 0.1;
CONSTANTS(:,51) = 0.8;
CONSTANTS(:,52) = 1.4;
CONSTANTS(:,53) = 1.4;
STATES(:,17) = 0.1;
CONSTANTS(:,54) = 0.32;
CONSTANTS(:,55) = 0.8;
CONSTANTS(:,56) = 0.4;
CONSTANTS(:,57) = 1.4;
CONSTANTS(:,58) = 0.2;
STATES(:,18) = 0.1;
CONSTANTS(:,59) = 3.0;
CONSTANTS(:,60) = 1.4;
CONSTANTS(:,61) = 0.4;
STATES(:,19) = 0.1;
CONSTANTS(:,62) = 3.0;
CONSTANTS(:,63) = 1.6;
if (isempty(STATES)), warning('Initial values for states not set');, end
end

function [RATES, ALGEBRAIC] = computeRates(VOI, STATES, CONSTANTS)
global algebraicVariableCount;
statesSize = size(STATES);
statesColumnCount = statesSize(2);
if ( statesColumnCount == 1)
STATES = STATES';
ALGEBRAIC = zeros(1, algebraicVariableCount);
utilOnes = 1;
else
statesRowCount = statesSize(1);
ALGEBRAIC = zeros(statesRowCount, algebraicVariableCount);
RATES = zeros(statesRowCount, statesColumnCount);
utilOnes = ones(statesRowCount, 1);
end
RATES(:,1) =  CONSTANTS(:,1).*(power(STATES(:,2), CONSTANTS(:,6))./(power(CONSTANTS(:,4), CONSTANTS(:,6))+power(STATES(:,2), CONSTANTS(:,6)))) - ( CONSTANTS(:,2).*(STATES(:,1)./(CONSTANTS(:,5)+STATES(:,1)))+ CONSTANTS(:,3).*STATES(:,1));
RATES(:,3) =  CONSTANTS(:,7).*(power(STATES(:,2), CONSTANTS(:,6))./(power(CONSTANTS(:,10), CONSTANTS(:,6))+power(STATES(:,2), CONSTANTS(:,6)))) - ( CONSTANTS(:,8).*(STATES(:,3)./(CONSTANTS(:,11)+STATES(:,3)))+ CONSTANTS(:,9).*STATES(:,3));
RATES(:,4) =  CONSTANTS(:,12).*(power(CONSTANTS(:,15), CONSTANTS(:,17))./(power(CONSTANTS(:,15), CONSTANTS(:,17))+power(STATES(:,5), CONSTANTS(:,17)))) - ( CONSTANTS(:,13).*(STATES(:,4)./(CONSTANTS(:,16)+STATES(:,4)))+ CONSTANTS(:,14).*STATES(:,4));
RATES(:,6) =  CONSTANTS(:,18).*(power(STATES(:,2), CONSTANTS(:,23))./(power(CONSTANTS(:,21), CONSTANTS(:,23))+power(STATES(:,2), CONSTANTS(:,23)))) - ( CONSTANTS(:,19).*(STATES(:,6)./(CONSTANTS(:,22)+STATES(:,6)))+ CONSTANTS(:,20).*STATES(:,6));
RATES(:,7) = ( CONSTANTS(:,24).*STATES(:,1)+ CONSTANTS(:,31).*(STATES(:,8)./(CONSTANTS(:,26)+STATES(:,8)))+ CONSTANTS(:,28).*STATES(:,9)) - ( CONSTANTS(:,30).*(STATES(:,7)./(CONSTANTS(:,25)+STATES(:,7)))+ CONSTANTS(:,27).*STATES(:,7).*STATES(:,10)+ CONSTANTS(:,29).*STATES(:,7));
RATES(:,10) = ( CONSTANTS(:,32).*STATES(:,3)+ CONSTANTS(:,35).*(STATES(:,11)./(CONSTANTS(:,26)+STATES(:,11)))+ CONSTANTS(:,28).*STATES(:,9)) - ( CONSTANTS(:,34).*(STATES(:,10)./(CONSTANTS(:,25)+STATES(:,10)))+ CONSTANTS(:,27).*STATES(:,7).*STATES(:,10)+ CONSTANTS(:,33).*STATES(:,10));
RATES(:,12) = ( CONSTANTS(:,36).*STATES(:,6)+ CONSTANTS(:,39).*STATES(:,5)) - ( CONSTANTS(:,38).*STATES(:,12)+ CONSTANTS(:,40).*(STATES(:,12)./(CONSTANTS(:,37)+STATES(:,12)))+ CONSTANTS(:,29).*STATES(:,12));
RATES(:,8) =  CONSTANTS(:,30).*(STATES(:,7)./(CONSTANTS(:,25)+STATES(:,7))) - ( CONSTANTS(:,31).*(STATES(:,8)./(CONSTANTS(:,26)+STATES(:,8)))+ CONSTANTS(:,41).*(STATES(:,8)./(CONSTANTS(:,37)+STATES(:,8)))+ CONSTANTS(:,29).*STATES(:,8));
RATES(:,11) =  CONSTANTS(:,34).*(STATES(:,10)./(CONSTANTS(:,25)+STATES(:,10))) - ( CONSTANTS(:,35).*(STATES(:,11)./(CONSTANTS(:,26)+STATES(:,11)))+ CONSTANTS(:,42).*(STATES(:,11)./(CONSTANTS(:,37)+STATES(:,11)))+ CONSTANTS(:,29).*STATES(:,11));
RATES(:,9) = ( CONSTANTS(:,46).*(STATES(:,13)./(CONSTANTS(:,26)+STATES(:,13)))+ CONSTANTS(:,27).*STATES(:,7).*STATES(:,10)+ CONSTANTS(:,44).*STATES(:,14)) - ( CONSTANTS(:,45).*(STATES(:,9)./(CONSTANTS(:,25)+STATES(:,9)))+ CONSTANTS(:,28).*STATES(:,9)+ CONSTANTS(:,43).*STATES(:,9)+ CONSTANTS(:,29).*STATES(:,9));
RATES(:,14) = ( CONSTANTS(:,50).*(STATES(:,15)./(CONSTANTS(:,26)+STATES(:,15)))+ CONSTANTS(:,43).*STATES(:,9)+ CONSTANTS(:,48).*STATES(:,16)) - ( CONSTANTS(:,49).*(STATES(:,14)./(CONSTANTS(:,25)+STATES(:,14)))+ CONSTANTS(:,44).*STATES(:,14)+ CONSTANTS(:,47).*STATES(:,2).*STATES(:,14)+ CONSTANTS(:,29).*STATES(:,14));
RATES(:,5) =  CONSTANTS(:,38).*STATES(:,12) - ( CONSTANTS(:,39).*STATES(:,5)+ CONSTANTS(:,51).*(STATES(:,5)./(CONSTANTS(:,37)+STATES(:,5)))+ CONSTANTS(:,29).*STATES(:,5));
RATES(:,13) =  CONSTANTS(:,45).*(STATES(:,9)./(CONSTANTS(:,25)+STATES(:,9))) - ( CONSTANTS(:,46).*(STATES(:,13)./(CONSTANTS(:,26)+STATES(:,13)))+ CONSTANTS(:,52).*(STATES(:,13)./(CONSTANTS(:,37)+STATES(:,13)))+ CONSTANTS(:,29).*STATES(:,13));
RATES(:,15) =  CONSTANTS(:,49).*(STATES(:,14)./(CONSTANTS(:,25)+STATES(:,14))) - ( CONSTANTS(:,50).*(STATES(:,15)./(CONSTANTS(:,26)+STATES(:,15)))+ CONSTANTS(:,53).*(STATES(:,15)./(CONSTANTS(:,37)+STATES(:,15)))+ CONSTANTS(:,29).*STATES(:,15));
RATES(:,17) = ( CONSTANTS(:,58).*(STATES(:,18)./(CONSTANTS(:,26)+STATES(:,18)))+ CONSTANTS(:,56).*STATES(:,2)+ CONSTANTS(:,54).*STATES(:,4)) - ( CONSTANTS(:,57).*(STATES(:,17)./(CONSTANTS(:,25)+STATES(:,17)))+ CONSTANTS(:,55).*STATES(:,17)+ CONSTANTS(:,29).*STATES(:,17));
RATES(:,18) =  CONSTANTS(:,57).*(STATES(:,17)./(CONSTANTS(:,25)+STATES(:,17))) - ( CONSTANTS(:,58).*(STATES(:,18)./(CONSTANTS(:,26)+STATES(:,18)))+ CONSTANTS(:,59).*(STATES(:,18)./(CONSTANTS(:,37)+STATES(:,18)))+ CONSTANTS(:,29).*STATES(:,18));
RATES(:,2) = ( CONSTANTS(:,61).*(STATES(:,19)./(CONSTANTS(:,26)+STATES(:,19)))+ CONSTANTS(:,55).*STATES(:,17)+ CONSTANTS(:,48).*STATES(:,16)) - ( CONSTANTS(:,60).*(STATES(:,2)./(CONSTANTS(:,25)+STATES(:,2)))+ CONSTANTS(:,56).*STATES(:,2)+ CONSTANTS(:,47).*STATES(:,2).*STATES(:,14)+ CONSTANTS(:,29).*STATES(:,2));
RATES(:,19) =  CONSTANTS(:,60).*(STATES(:,2)./(CONSTANTS(:,25)+STATES(:,2))) - ( CONSTANTS(:,61).*(STATES(:,19)./(CONSTANTS(:,26)+STATES(:,19)))+ CONSTANTS(:,62).*(STATES(:,19)./(CONSTANTS(:,37)+STATES(:,19)))+ CONSTANTS(:,29).*STATES(:,19));
RATES(:,16) =  CONSTANTS(:,47).*STATES(:,2).*STATES(:,14) - ( CONSTANTS(:,48).*STATES(:,16)+ CONSTANTS(:,63).*(STATES(:,16)./(CONSTANTS(:,37)+STATES(:,16)))+ CONSTANTS(:,29).*STATES(:,16));
RATES = RATES';
end

% Calculate algebraic variables
function ALGEBRAIC = computeAlgebraic(ALGEBRAIC, CONSTANTS, STATES, VOI)
statesSize = size(STATES);
statesColumnCount = statesSize(2);
if ( statesColumnCount == 1)
STATES = STATES';
utilOnes = 1;
else
statesRowCount = statesSize(1);
utilOnes = ones(statesRowCount, 1);
end
end

% Pad out or shorten strings to a set length
req_length = 160;
insize = size(strin,2);
if insize > req_length
strout = strin(1:req_length);
else
strout = [strin, blanks(req_length - insize)];
end
end

```
Source
Derived from workspace Leloup, Goldbeter, 2003 at changeset 6de424a124d8.
Collaboration
To begin collaborating on this work, please use your git client and issue this command: