Evaluating the Model Parameters
Use the command mphevaluate to evaluate the expression defined in the Parameters node as in the command below:
value = mphevaluate(model, <expr>)
The evaluation does not require an existing solution dataset in the model, which means that you can evaluate the expression even if there is no solution computed in the model.
To evaluate multiple expressions at once, define <expr> as a cell array of expressions as in the command below:
str = mphevaluate(model, {<expr1>, <expr2>, ...})
The output str is an array of structs with the same size as for the cell array of expressions. For multiple parameters evaluation only a single output is permitted. The struct contains the following fields: name, the parameter name; value, its value in the unit specified in the field unit; def, the string for the definition of the parameter; and descr, the string description of the parameter.
To evaluate all the parameters defined in the table, enter:
str = mphevaluate(model)
The output str is an array of structs with the same size as for the parameters table.
Get the full information of a model parameter expression with the command:
[value, unit, def, descr] = mphevaluate(model, <expr>)
where value, unit, def, and descr are the parameter value, the parameter unit, the parameter definition and the parameter description, respectively.
You can specify the unit of the expression to evaluate with the command:
value = mphevaluate(model, <expr>, <unit>)
where <unit> is the unit to evaluate the expression <expr> in.
To evaluate and return only the value of the expression, use the command:
value = mphevaluate(model, <expr>, <unit>, 'value')
To evaluate and return only the unit of the expression, use the command:
value = mphevaluate(model, <expr>, <unit>, 'unit')
To evaluate and return the definition string of the expression, use the command:
value = mphevaluate(model, <expr>, <unit>, 'valueunit')
The above command can be used to set a new parameter using an existing one.