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

1 次查看(过去 30 天)
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?

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Programmatic Model Editing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by