Can I pass a "coder.opaque" variable from one Matlab function to another inside a StateFlow diagram?

Viewed 33

I have a StateFlow chart (C action language) that calls a Matlab function embedded on it. This Matlab function calls an external C function using coder.ceval, which returns a variable that is declared using coder.opaque.

I have another Matlab function embeeded on the same Stateflow that calls another external C function and that requires the coder.opaque variable returned by the previous Matlab function to be passed as an argument.

Is there a way that I can pass that coder.opaque variable from the first Matlab function block to the second one?

I would imagine that joining the two Matlab functions inside the same block (and adding a switch-case statement to execute one or the other) can work, but I would really like to have them in separate blocks.

My objective is to generate the code of the model. Thanks in advance!

0 Answers
Related