Info
Questa domanda è chiusa. Riaprila per modificarla o per rispondere.
How to use 'fmincon' in hardware through simulink without any code generation error?
1 visualizzazione (ultimi 30 giorni)
Mostra commenti meno recenti
Hello, I'm going to update a simulink program into hardware with a function 'fmincon', but there is one error about code generation, how can I solve it?
2 Commenti
Walter Roberson
il 13 Ago 2020
Modificato: Walter Roberson
il 14 Ago 2020
Which release are you using?
The documentation indicates that you need MATLAB Coder, and Embedded Coder too for deploy to hardware. There are a number of other restrictions too such as only supporting sqp or Sqp-legacy.
Generally speaking, Simulink Coder does not support matlab functions that you need Coder.extrinsic for.
Risposte (1)
Walter Roberson
il 14 Ago 2020
Generally speaking, Simulink Coder does not support matlab functions that you need Coder.extrinsic for.
MATLAB Coder does support fmincon, under particular restrictions. As MATLAB Coder is a requirement to install Simulink Coder, then you can write your minimization code into a function, and use MATLAB Coder to generate C or C++ code for it. Then in your MATLAB Function Block, you can coder.ceval() the function you created -- or perhaps use a C Caller Block instead of MATLAB Function Block.
0 Commenti
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!