I am working with Simulink blocks that can take in parameters from edit boxes. In addition to, for example, numerical values, I can enter a variable name corresponding to a Simulink.Parameter object. This works fine for a single object, but not when indexing into an array of objects or when indexing into an array contained in an object.
For example:
a(1) = Simulink.Parameter;a(2) = Simulink.Parameter;
If we type "a(1)" into the Mask parameter edit box, the following error comes up in a pop-up window:
"Error due to multiple causes. --> Variable 'a' is resolved in workspace ('base') for block 'BLOCKNAME' but it is an array of objects".
However, creating a variable "a1" and using that as the parameter in the mask works fine:
a1 = a(1);
In addition, let us say we have a double array b = [1 2]. Using "b(1)" as the Mask parameter also works fine.
Why is this?
Best Answer