I am trying to run a PID controller (another model in simulink) using sim command in a matlab function block. However it takes long iteration, seems to be that the matlab function block need more time.
How to get faster result?
Here is my code in matlab function block:
function [Kpp,Kii,Kdd] = fcn(u)
coder.extrinsic('sim');
sim('ExternePID'); %call out to ExternePID model