Matrices in Cameo and MatLab Shared Workspace

  1. I am trying to cast matrices to value properties to be used as inputs to a constraint block in a parametric diagram, and initially I was using the built in math solver to simulate this. The built in math solver, when simulated, would return unexpected values. For instance, the Cameo documentation states, "You can add a matrix to the built-in math solver by the following syntax (a semi-colon is used as a row separator and comma or space is used as a column separator." Documentation was found here: https://www.magicdraw.com/files/manuals/beta/Cameo%20Simulation%20Toolkit%20UserGuide.pdf section 11.3.3.4. 

    The unexpected behavior is the following scenario: Any combination of rows/columns to assigned to a value property, when simulated, would be turned into comma separated values and it seemed as if the first column was represented first followed by the second column, i.e. [1 2 3; 4, 5, 6] when simulated the value appeared as -> [1, 3, 2, 4, 5, 6]. Initially this seemed like it took the 2x3 matrix and turned it into a 1x6 matrix since the documentation states the commas represent columns. To confirm the suspicion I took to the Cameo documentation once more to find built in functions to see if there was a function call to display the number of rows/columns. There was, the size function. The output of the size function actually shows there to be 6 rows and 1 column! The size function is found on page 101 of the link above.

    I was determined something was wrong with the built in math solver so I integrated Matlab with Cameo, unfortunately the results were the same. Below is a picture of the scenario.

    Note: before I could even see a an output from the constraint block I needed to set multiplicity to *, as well as the 'is unique' field needed to be set to un-checked. Maybe there's another simple setting I'm over looking? 

2. Once I switched over to Matlab and saw the power of the integration between the two tools I got really excited. The problem is I can't seem to utilize the full potential because I can't access the 'shared' workspace. I share the Matlab engine via the following command: matlab.engine.shareEngine within the Matlab instance outside of Cameo. I found another command to display which engine you are using: matlab.engine.engineName. I'm leaning towards the cause of the non-shared workspace is because when I run the matlab.engine.engineName in the Matlab instance and within the Matlab command window within Cameo I get different engines as results suggesting different sessions, which seems like a valid reason as to why there is no shared workspace. What am I missing to enable synchronization between the two Matlab sessions?