I call some matlab scripts from a simulink model, these use assert(). When an assertion fails, simulink gives me a completely useless assertion, without any details about which sub-system or script the assertion occurred in, let alone the line number:
An error occurred while running the simulation and the simulation was terminated
Caused by:
An error occurred during simulation of Model block '<blah>/Model'.
Assertion failed.
However, this is just a model block, it contains many sub-systems and script blocks and stuff.
Any hints on how to find which of my many assertions was triggered?
Not sure it matters, but all of these scripts use the %#codegen
tag.
assert()
supports custom error messages:Since you have access to the scripts being run, you can update them to include verbose error messages.
For example:
vs.