Inside Simulink, I have a model of a sensor. A larger system contains several of these sensors, each sensor is functionally the same but needs to have different parameters put into each one.
I have tried to do this by creating variables with a script in the matlab workspace for example:
sensor1.bias = 1; sensor1.scaleFactor = 2; sensor2.bias = 3; sensor2.scaleFactor = 4; etc creating a structure.
I then created a Mask for the first referenced model for each instance with the property name 'sensor' and property value 'sensor1' and for the second referenced model property name 'sensor' and property value 'sensor2'. The idea of this is to pass the correct values through.
The variable names inside the sensor are sensor.bias and sensor.scaleFactor. The idea is that a different structure is fed into each referenced model but it doesn't work! I get the following error:
Invalid setting in 'refTest/Constant' for parameter 'Value'
Error evaluating parameter 'Value' in 'refTest/Constant'
Undefined variable "sensor" or class "sensor.bias".
This seems like the most logical way to pass variables through since i have around 50 different parameters for each sensor. Why doesn't this work? I would appretiate any help! thank you