Importing elements of a structure from MATLAB workspace based on a user given constant in Simulink.

1 Ansicht (letzte 30 Tage)
Hi,
I have various structures in my MATLAB workspace. Each of them consists of 6 fields of 'double' type. I want to pass one of these structures to a function in simulink based on what value is selected for a particular constant.
Example:
I have two structures labelled ABC and DEF. ABC has 6 fields called ABC.a, ABC.b, ABC.c, ABC.d, ABC.e and ABC.f. Same goes for DEF.
Now if user inputs constant 1 in a user input block in simulink, I want to pass the structure 'ABC' to a matlabfunciton block in simulink otherwise i wanna pass structure 'DEF'.
What would be an efficient way to do it?

Antworten (0)

Kategorien

Mehr zu Programmatic Model Editing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by