How to select a structure as a tunable parameter for a protected model?

7 ビュー (過去 30 日間)
Haotian
Haotian 2025 年 7 月 30 日
回答済み: Alan 2025 年 8 月 5 日
I create a structure in base workspace then use it to configure my simulink subsystem through mask, everything goes well. But once I protect the subsystem, the subsystem configuration remains unchanged even if the structure in base workspace is changed, and I cannot select the structure as the tunable parameter for the generated protected model, how can I solve this problem?

回答 (1 件)

Alan
Alan 2025 年 8 月 5 日
Hello Haotian,
I assume you are providing a structure as a tunable parameter using the “Simulink.Bus” class. I am also not able to find tunable parameters while creating a protected model.
The following workflow is an alternate workflow I tried with Simulink R2025a and R2025a Update 1.
  1. Follow the steps below to create a mask variable marked as a model argument: Create and Reference a Masked Model
  2. Then, convert the model reference to protected.
  3. Right click and select “Block Parameters” and add “.slxp” to the “Model name” field.
  4. Set the mask, save the model and simulate it.
However, I was not able to edit the block parameters through the mask, even for variables of other data types, not just structures.
This could be a bug. The next step could be to reach out to MathWorks Technical support: Contact Support - MATLAB & Simulink
Regards,
Alan

製品


リリース

R2025a

Community Treasure Hunt

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

Start Hunting!

Translated by