Dynamics Mask Icons for Subsystem Variants
Today I will illustrate how to combine two features I like: Subsystem Variants and Masking.
I created a subsystem with two variants and I have specific masks for each variant:
I would like to automatically display the mask of the active variant on the top subsystem.
The SolutionAs you probably guessed, the trick is to define the correct Icon Drawing Commands for the top subsystem. After juggling with multiple options, I came up with the following process:
- Use get_param to determine the active variant
- Use find_system to determine the subsystem corresponding to the active variant
- Use get_param to obtain a string containing the Icon Drawing Commands of the active variant
- Evaluate this string as the top subsystem Icon Drawing Commands
All together, the Mask Editor should look like this:
And your model will behave like this:
Now it's your turn
Have you integrated Subsystem Variants in your workflow? Leave a comment here.
댓글을 남기려면 링크 를 클릭하여 MathWorks 계정에 로그인하거나 계정을 새로 만드십시오.