Hello to everyone,
I am working on a project and the goal is to tune a PI Controller for my model using the genetic algorithm. For faster execution, the genetic algorithm should run with a c code (replacing the simulink model). For C code generation, simulink coder is used.
I can't call the c code inside the callback function, wich is called from the genetic algorithm. The c code for the model simulation should be a function taken two parameters (the parameters to optimize).
The following code is the callback function wich is called by the genetic algorithm:
The main problem is following: how can i generate a function from my simulink model wich will take two parameter as variables?
function y = GNMReglerPIfcn(x)