Can a structure variable be updated within MATLAB Function block in Simulink?

1 view (last 30 days)
I am running a simulation of a physical system in Simlink using a MATLAB function block. In this regard, I have some parameters that are defined in a structure in MATLAB workspace. I passed that structure by defining it as a parameter to the MATLAB function block. However, the code in the block attempts to add more fields to that structure, but the Simulink won't allow me to do that, giving the following error:
new fields cannot be added when structure has been read or used
Is there a way I can dynamically update the structure within the Function block?
Thanks

Answers (0)

Categories

Find more on Simulink Functions in Help Center and File Exchange

Products


Release

R2019a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!