フィルターのクリア

Controlling the operator of a relational operator block inside a protected model

2 ビュー (過去 30 日間)
Saiesh Singh
Saiesh Singh 2024 年 1 月 5 日
回答済み: Fangjun Jiang 2024 年 1 月 5 日
I have a model in which a relational operator block is used. I am going to export this model as a protected model and then reference it in a reference model block in a new model. I am trying to create a mask for the reference model block through which I can let the user select the operator to be used in the relational operator block inside this locked model.
If this was not a protected model, a simple parameter promotion in the mask editor would have worked. But since this is a protected model, I am unable to do this. Is there a way to acheive this functionality? I usually create a parameter in the model workspace and set is an argument so when I export it as a protected model, I can assign values to the parameter through the mask. Is there some way to set the operator selection as a parameter? Or, is there a different way to approach this problem?

回答 (1 件)

Fangjun Jiang
Fangjun Jiang 2024 年 1 月 5 日
In the model, have 5 (for example) relational operator blocks. Each block applies one of the relational operators that you want. Use a Miltiport switch block to pass the output. Define a model parameter valued from 1 to 5 to control (select) the multiport switch. This is not the most efficient but it should work out.

カテゴリ

Help Center および File ExchangeComponent-Based Modeling についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by