How to implement a cascading option in simulink?

20 次查看(过去 30 天)
审言
审言 2024-10-23,9:26
回答: Sahas 2024-10-23,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.

回答(1 个)

Sahas
Sahas 2024-10-23,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!

类别

Help CenterFile Exchange 中查找有关 Subsystems 的更多信息

产品


版本

R2024b

Community Treasure Hunt

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

Start Hunting!

Translated by