How to implement a cascading option in simulink?

2 visualizzazioni (ultimi 30 giorni)
审言
审言 il 23 Ott 2024
Risposto: Sahas il 23 Ott 2024
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.

Risposte (1)

Sahas
Sahas il 23 Ott 2024
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!

Categorie

Scopri di più su Subsystems in Help Center e File Exchange

Prodotti


Release

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by