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

2 次查看(过去 30 天)
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 CenterFile Exchange 中查找有关 Component-Based Modeling 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by