How to implement a cascading option in simulink?

6 visualizaciones (últimos 30 días)
审言
审言 el 23 de Oct. de 2024
Respondida: Sahas el 23 de Oct. de 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.

Respuestas (1)

Sahas
Sahas el 23 de Oct. de 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!

Categorías

Más información sobre Subsystems en Help Center y File Exchange.

Productos


Versión

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by