On 4/13/2017 3:25 PM, Suvrat Ramasubramanian wrote:
> Hi All,
>
> I am trying to tune the pid gain using the optimization algorithm in
> matlab and update the values in the simulink gain block while the
> simulation is executing.
> When im trying to execute the function i get the following error:
>
> Error evaluating parameter 'Gain' in
> 'speed_model_pid/Subsystem/Derivative Gain' Error using fun (line 9)
> Undefined function 'x' for input arguments of type 'double'.
> Failure in initial user-supplied fitness
> function evaluation. GA cannot continue.
>
> I have tried finding the solution online but couldnt find anything
> specific to my problem.
>
> I'd appreciate if someone could help me.
>
> Regards
Maybe this post will help you fix your problem:
https://www.mathworks.com/matlabcentral/answers/92888-how-do-i-run-a-model-in-simulink-from-my-matlab-function-where-my-simulink-parameters-are-defined-in
Alan Weiss
MATLAB mathematical toolbox documentation
> Hi All,
>
> I am trying to tune the pid gain using the optimization algorithm in
> matlab and update the values in the simulink gain block while the
> simulation is executing.
> When im trying to execute the function i get the following error:
>
> Error evaluating parameter 'Gain' in
> 'speed_model_pid/Subsystem/Derivative Gain' Error using fun (line 9)
> Undefined function 'x' for input arguments of type 'double'.
> Failure in initial user-supplied fitness
> function evaluation. GA cannot continue.
>
> I have tried finding the solution online but couldnt find anything
> specific to my problem.
>
> I'd appreciate if someone could help me.
>
> Regards
Maybe this post will help you fix your problem:
https://www.mathworks.com/matlabcentral/answers/92888-how-do-i-run-a-model-in-simulink-from-my-matlab-function-where-my-simulink-parameters-are-defined-in
Alan Weiss
MATLAB mathematical toolbox documentation