Is there a way to run fmincon from a MATLAB function block in Simulink?

2 views (last 30 days)
Hello everyone,
I am trying to run a constrained nonlinear optimization problem in Simulink. The results of this optimization are used in a dynamical system that runs in the same file. I was wondering if anyone knows of a way to call fmincon from Simulink or, alternatively, a method to perform constrained optimization in Simulink.
Thanks in advance for your help.
Fernando

Answers (1)

Azzi Abdelmalek
Azzi Abdelmalek on 15 Apr 2016
You can call it from Matlab function block
  1 Comment
Fernando
Fernando on 19 Apr 2016
Edited: Fernando on 19 Apr 2016
Hello Azzi,
Thanks a lot for your answer. Do you mean the Interpreted MATLAB Function Block or the MATLAB Function Block? I tried with the second but it did not let me use function handles to eventually call fmincon. Another question if you do not mind, do you know what would be the output of the block if the optimization algorithm has not finished yet?
Thanks again,
Fernando

Sign in to comment.

Categories

Find more on Get Started with Optimization Toolbox in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!