The MDES block cannot directly access variables like “MyData” from the base or model workspace, so referencing “MyData(5,9)” inside the MDES will not work. Instead, you need to pass your data as a parameter to the MDES block to use it in your code.
- Add a Parameter to the MDES Block: In the MDES editor, go to the Parameters tab and add a new parameter named “MyData”.
- Set the Parameter Value in Simulink: In your Simulink model, click on the MDES block, open its parameters dialog, and set “MyData” to the name of your imported matrix (for example, “MyData”).
- Use the Parameter in Your MDES Code: In your MDES code, access the data using “self.MyData”. For example:
entity.AttributeX = self.MyData(5,9);
This way, your external data will be available inside the MDES block for your scheduling logic.
Following is the official documentation link for further understanding :
Hope this helps!