Application of casadi in rapid control prototype

8 vues (au cours des 30 derniers jours)
Bowling
Bowling le 8 Mar 2023
Commenté : Bowling le 21 Mar 2023
The controller is coded in Simulink with "Matlab Function" module. When casadi toolbox is called using code 'import casadi.*' (like m.file), the compiler would go wrong with following information as :
"Import statements are currently unsupported. Function 'XXX' (#XXX.XXX.XXX), line XXX, column XXX: "import" Launch diagnostic report."
So how to call casadi in "Matlab Function" module correctly?
  2 commentaires
Daniel Alejandro Poveda Pi
Hi! i'm having exactly the same issue! Could you please let me know if you find a way of making it work? (I'll for sure do the same if I manage to solve it).
Thanks for your time,
Daniel
Bowling
Bowling le 21 Mar 2023
Thank you for following this issue! Now I could run it in Simulation/Debug mode with "Matlab Function" block.
First, you need to write external function (like case.m file). Then, the external function needs to be declared before calling it with code "coder.extrinsic('case');" in "Matlab Function" block. In this way, it can work wel in these two modes.
However, the external declaration function can't build application which causes can't work in RCP platform.
If you have some advice, please leave a message!
Luka

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur COM Component Integration dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by