sbiolasterror
SimBiology last error message
Syntax
sbiolasterror
diagstruct
= sbiolasterror
sbiolasterror([])
sbiolasterror(diagstruct
)
Arguments
| The diagnostic structure holding Type , Message
ID , and Message for the errors. |
Description
sbiolasterror
or
return
a SimBiology® diagnostic structure array containing the last error(s)
generated by the software. The fields of the diagnostic structure
are: diagstruct
= sbiolasterror
Type | 'error' |
MessageID | The message ID for the error (for example, 'SimBiology:ConfigSetNameClash' ) |
Message | The error message |
sbiolasterror([])
resets
the SimBiology last error so that it will return an empty
array until the next SimBiology error is encountered.
sbiolasterror(
will
set the SimBiology last error(s) to those specified in the diagnostic
structure (diagstruct
)
).diagstruct
Examples
This example shows how to use verify
and sbiolasterror
.
Import a model.
openExample('radiodecay.xml'); a = sbmlimport('radiodecay.xml')
a = SimBiology Model - RadioactiveDecay Model Components: Compartments: 1 Events: 0 Parameters: 1 Reactions: 1 Rules: 0 Species: 2 Observables: 0
Change the
ReactionRate
of a reaction to make the model invalid.a.reactions(1).reactionrate = 'x*y'
a = SimBiology Model - RadioactiveDecay Model Components: Compartments: 1 Events: 0 Parameters: 1 Reactions: 1 Rules: 0 Species: 2 Observables: 0
Use the function
verify
to validate the model.a.verify
Error using SimBiology.Model/verify --> Error reported from Expression Validation: Name 'y' in reaction 'Reaction1' does not uniquely refer to any species, parameters, or compartments according to SimBiology precedence rules.
Retrieve the error diagnostic
struct
.p = sbiolasterror
p = struct with fields: Type: 'Error' MessageID: 'SimBiology:ReactionObjectDoesNotResolve' Message: 'Name 'y' in reaction 'Reaction1' does not uniquely refer to any species, parameters, or compartments according to SimBiology precedence rules.↵'
Reset
sbiolasterror
.sbiolasterror([]);
Set
sbiolasterror
to the diagnostic structure p.sbiolasterror(p);
Version History
Introduced in R2006a