How to implement a cascading option in simulink?

20 views (last 30 days)
审言
审言 on 23 Oct 2024 at 9:26
Answered: Sahas on 23 Oct 2024 at 10:12
I want to implement cascading options in Simulink Mask Dialog, and I also want to use pure code in a MATLAB System block to achieve this cascading. Are there any methods?
e.g. There are two attributes Name & Value
Name: aaa, bbb
If I select "aaa," the values displayed will be 333 and 444; if I select "bbb," the values displayed will be 666 and 777.

Answers (1)

Sahas
Sahas on 23 Oct 2024 at 10:12
Hi @审言,
As per my understanding, you would like to use the MATLAB System block in Simulink and define two mask parameters "Name" and "Value" and the values of "Value" parameters should depend on value selected for "Name" parameter.
I was able to create and modify the mask parameters of the MATLAB System block by creating a small callback function and using MATLAB's "get_param" and "set_param" functions to access and setting the mask parameters. For more information and steps to write Mask Parameters callback code, refer to the folloing MathWorks documentation:
Refer to the following MathWorks documentation links for detailed instructions to create custom MATLAB System blocks and steps to modify it's mask parameters:
I hope this is beneficial!

Products


Release

R2024b

Community Treasure Hunt

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

Start Hunting!