MATLAB: It is not possible to set a struct with a char field/non numerical field in it as a tunable parameter (Model Parameter Configuration dialog)

charfieldparametersimulinkstringstrucstructtunable

Why is it not possible to set a struct variable with a non numeric value as a tunable parameter?

Best Answer

When choosing workspace variables to be tunable through the GUI, if the variable is a structure, then the entire structure must be numeric for it to be listed. The doc states that the source list includes:
  • MATLAB® workspace — Lists all variables in the MATLAB workspace that have numeric values.
It also suggests:
The tool looks at each variable in the workspace to check if it is numeric. If the user chooses the variable to be tunable, then the entire variable will be flagged as tunable. In this case, the variable is a structure. This means that the entire structure must be numeric. If just one field is not, then the variable is not numeric and therefore not tunable.