Are the "Gain Values" of the "Discrete Derivative" and "Discrete Time Integrator" blocks tunable?
In my model these gains are in a structure MDLparam.ki and MDLparam.kd. where MDLparam is a Simulink.Parameter object. When I generate code or run the simulation I get the following warnings and as a result these two gain values do not appear tunable in the generated code:
Warning: Reducing expression 'MDLaram.kd' in parameter field 'gainval' of 'MDL/Discrete Derivative' to its numerical equivalent because this field is marked not tunable. This expression resolves to tunable variables (MDLparam (base workspace)). You will be unable to tune this expression during model execution
Warning: Parameter field 'gainval' of 'MDL/Discrete-Time Integrator' is non-tunable but refers to tunable variables (MDLparam (base workspace))
Best Answer