To evaluate a global expression at the MATLAB® prompt, call the function
mphglobal as in this command:
where e1,... are the COMSOL Multiphysics
global expressions to evaluate. The output values
d1,... are returned as a Px1 double array, with P the length of inner parameters.
The function mphglobal supports the following properties to set the data of the evaluation to perform:
<dsettag> is the tag of a solution dataset. The default value is the current solution dataset of the model.
where <solnum> is an integer array corresponding to the inner solution index.
<solnum> can also be a string:
'end' or
'all' to evaluate the expression for the last inner solution or all inner solutions, respectively. By default the evaluation is performed on all inner solutions.
where <outersolnum> is a positive integer corresponding to the outer solution index.
<outersolnum> can also be a string,
'all' or
'end' to evaluate the expression for all or the last outer solution, respectively. The default settings uses the first outer solution for the data evaluation.
where <time> is a double array. The default value corresponds to all the stored time steps.
The function mphglobal also supports other output formats.
with unit is a 1xN cell array where N is the number of expressions to evaluate.
Set the
unit property to specify the unit of the evaluation:
where <unit> is a cell array with the same length as
<expr>.
Use the property matherr to return an error for undefined operations or expressions: