I want to set a variable step size for every solver step by using the command in the S-function like:
dT= ... % calculate the dT from the inputs of Block and the parameters of S-function
set_param(gcs,'...',num2str(dT));
However, the Matlab does not provide us with a assignable parameter like 'Step' for specifing the solver step size by using the command "set_param()" above. The callable and assignalbe parameters for the solver step size are only 'MaxStep' and 'MinStep'. Therefore, the following two commands are acceptable and executable in Simulink:
set_param(gcs,'MaxStep',num2str(dT1));
set_param(gcs,'MinStep',num2str(dT2));
Thus, I was trying to assign a same value to dT1 and dT2 in order to get the a certain step size, but there was immediately a error report indicating that the max. step and min. step cannot be the same.
So my question is how to specify a step size to the solver in the script of S-function?