Page 1 of 1

Running a Matlab Function in Constraint Block

PostPosted: Sun Jul 11, 2021 2:50 pm
by constantinos.florides@rwth-aachen.de
Hallo,
i have a matlab script that runs a function with 28 Inputs and 4 Outputs. I have modelled this function in a constraint block. Also some of the inputs are strings, so i changed the type of these values to strings.So i am running this Constraint Block, i type the values and nothing happens. I donĀ“t even can check if my simulation is runnng. But apparently it is not working. This Matlab code outside of cameo works fine. So do you have any advices? thank you very much

Re: Running a Matlab Function in Constraint Block

PostPosted: Wed Jul 14, 2021 4:25 am
by saulius_p
Hello,

Good to talk to you.

There was a problem about sending string value to Matlab in CST 19.0 sp4.
It is fixed in 2021x and later versions.

Sincerely,
Saulius

Re: Running a Matlab Function in Constraint Block

PostPosted: Wed Jul 14, 2021 6:06 am
by constantinos.florides@rwth-aachen.de
Thank you for your reply, i am currently using CSM 19.0 SP3.
I passed a string in Matlab and i coud run my simulation. But the results of Matlab were not transferred in CSM SImulation console. I already checked and my outputs from matlab are 4 double numbers,but in CSM would not appear. Do you have any suggestion why is that happenning?

Thank you very much,
Constantinos

Re: Running a Matlab Function in Constraint Block

PostPosted: Wed Sep 15, 2021 12:00 pm
by michael.enoch@lmco.com
I am also having this issue with Cameo not processing return values or strings generated by the MATLAB functions. I also see Cameo generating errors when I try to pass strings and structs to the MATLAB functions.

Moving to Cameo 2021x is not a viable option at this time. Is there any alternative to doing that? Any other workaround or even confirmation that the MATLAB integration works properly in an earlier version of Cameo?

Thank you.

Re: Running a Matlab Function in Constraint Block

PostPosted: Thu Sep 23, 2021 3:05 pm
by saulius_p
Hello,

Good to talk to you. This issue is known and fixed in recent release v2021x

Do you need to pass string into Matlab? Maybe integer or real can be passed as workaround?

Sincerely,
Saulius