Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Save a Sbiomodel

Subject: Save a Sbiomodel

From: Jerry

Date: 3 Dec, 2012 14:16:07

Message: 1 of 1

Hello,

I wrote following reactions and kinetic laws please see the below.

%1
Dollar = sbiomodel('BofA');

react1 = addreaction(Dollar, 'A + B -> A-B');
kineticlaw1 = addkineticlaw(react1, 'MassAction');
addparameter(kineticlaw1, 'a1',10);
set(kineticlaw1,'ParameterVariableNames',{'a1'});
set(Dollar.Reactions(1).Reactants(1), 'InitialAmount', 0);
set(Dollar.Reactions(1).Reactants(2), 'InitialAmount', 3);
set(Dollar.Reactions(1).Products(1), 'InitialAmount', 0);
%2
react2 = addreaction(Dollar, 'C + B <-> C-B');
kineticlaw2 = addkineticlaw(react2, 'MassAction');
addparameter(kineticlaw2,'a2',3);
addparameter(kineticlaw2,'a3',4);
set(kineticlaw2,'ParameterVariableNames',{'a2', 'a3'});
set(Dollar.Reactions(2).Reactants(1), 'InitialAmount', 0.01);
set(Dollar.Reactions(2).Reactants(2), 'InitialAmount', 0.0001);
set(Dollar.Reactions(2).Products(1), 'InitialAmount', 0);

I would like to save all these lines as a "sbiomdel" and when I call it as a model for example Dollar = sbiomodel ('BofA'), I ought not to write all these lines again.

Does anyone know a function that will allow me to save the model (these lines as a model)?

Thanks,
Jerry

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us