How to access structure variables defined in c files for simulink models
1 view (last 30 days)
rajat aggarwal on 14 May 2020
In order to access the fields stored within the structure, you can dot-index into the object, but there is difference in how you index into the object from Simulink blocks and the MATLAB command prompt.
From a Simulink block (like Gain) you can access the structure field by indexing into the Simulink object itself.
From the MATLAB command prompt, you would need to index into the 'Value' field of the object first:
If you intend to modify the value of the field, you can achieve this using the MATLAB command prompt
>> test.Value.a = 10;
I have also included a link to the Simulink.Parameter object description below