The model calls the same Matlab function twice, and, should produce the same results as described in the comments notated in the model. ultimately, as presented, the input array should get transposed twice, and in the end, "a" should equal "b".
The following is the list of observed issues & questions:
- [1] Setting a single breakpoint "ON EXIT" (or "ON ENTRY") should only be encountered one time; however it is encountered more than twice. (breakpoint is set on the input to either constraint).
[2] Execution of the simulation takes 3 or more clicks to even get the first solver to run. (See Notes below).
[3] Execution of the simulation never ends. The value of "b" is never set. (There is nothing blocking the input, and the Matlab console shows the results were solved).
[4] Execution of the simulation calls the second solver with an empty array in the middle of execution (pin inputs are [1..*] so it should wait for real input).
[5] The arrays are transposed to be "column vectors" when passed to Matlab regardless of what they were when they were passed to the input pin. (This is confirmed by the inconsistent behavior of the inputs and the associated Matlab outputs seen on the Matlab console output in the simulation toolkit window.
Attached a model with comments added to help demonstrate the odd behavior; hopefully this will help identify what is going wrong.
Note: the Matlab code is also added as a comment in the mdzip as well as the matlab function added to the attachments.
Note: Set Cameo options: Environment:Simulation:"Autostart Active Objects:False" & "Solve After Initialization:False" for debugging does not help isolate the issues.
Note: This is seen using Cameo 2019SP4 with Simulation Toolkit. The issue occurs with both Matlab 2019b and 2021b.