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

3 views (last 30 days)
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?

Answers (1)

Fangjun Jiang
Fangjun Jiang on 5 Jan 2024
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.

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!