I would like to pass a Simulink.Parameter object as a structure to a Simulink block using SET_PARAM.
For example:
example.data.Gain(2).p = Simulink.Parameter;example.data.Gain(2).p.Value = 1;example.data.Gain(2).p.Min = 0;example.data.Gain(2).p.Max = 10;mws = get_param(gcs, 'modelworkspace');mws.assignin('ex', example );set_param([sys '/Gain2'], 'Gain', 'ex.data.Gain(2).p');%%%END CODE
when I try that I get this error:
Expression 'ex.data.Gain(2).p' for block 'test2/Gain2' returns a Simulink.Parameter object that has property values that need to be evaluated. This object should
be instantiated in a workspace and referenced by name in Simulink.
Best Answer