| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → SimBiology |
| Contents | Index |
| Learn more about SimBiology |
sbiolasterror
diagstruct = sbiolasterror
sbiolasterror([])
sbiolasterror(diagstruct)
| diagstruct | The diagnostic structure holding Type, Message ID, and Message for the errors. |
sbiolasterror or diagstruct = sbiolasterror return a SimBiology diagnostic structure array containing the last error(s) generated by the software. The fields of the diagnostic structure are:
| 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(diagstruct) will set the SimBiology last error(s) to those specified in the diagnostic structure (diagstruct).
This example shows how to use verify and sbiolasterror.
Import a model.
a = sbmlimport('radiodecay.xml') SimBiology Model - RadioactiveDecay
Model Components:
Models: 0
Parameters: 1
Reactions: 1
Rules: 0
Species: 2
Change the ReactionRate of a reaction to make the model invalid.
a.reactions(1).reactionrate = 'x*y'
SimBiology Model - RadioactiveDecay
Model Components:
Models: 0
Parameters: 1
Reactions: 1
Rules: 0
Species: 2
Use the function verify to validate the model.
a.verify
??? Error using==>simbio\private\odebuilder>buildPatternSubStrings
The object y does not resolve on reaction with expression'x*y'.
Error in ==> sbiogate at 22
feval(varargin{:});
??? --> Error reported from Expression Validation :
The object 'y' in reaction 'Reaction1' does not resolve
to any in-scope species or parameters.
--> Error reported from Dimensional Analysis :
Could not resolve species, parameter or model object 'y'
during dimensional analysis.
--> Error reported from ODE Compilation:
Error using==>simbio\private\odebuilder>buildPatternSubStrings
The object y does not resolve on reaction with expression 'x*y'.Retrieve the error diagnostic struct.
p = sbiolasterror
p =
1x3 struct array with fields:
Type
MessageID
MessageDisplay the first error ID and Message.
p(1)
ans =
Type: 'Error'
MessageID: 'SimBiology:ReactionObjectDoesNotResolve'
Message: 'The object 'y' in reaction 'Reaction1'
does not resolve to any in-scope
species or parameters.'Reset the sbiolasterror.
sbiolasterror([])
ans =
[]Set sbiolasterror to the diagnostic struct.
sbiolasterror(p)
ans =
1x3 struct array with fields:
Type
MessageID
Message![]() | sbiohelp | sbiolastwarning | ![]() |

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |