Simulink Selector block with parameterised indices in masked Referenced Model
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
In Simulink, I am trying to create a masked Referenced Model 'masked_X' whose input is one element of a single vector of several hundreds of signals. I would like to use a Selector block for this selection, with the Index specified as a field of a structured parameter (i.e. say p.p_index) of the mask. However, I get the following error when running the model:
For dimensions 1, parameter 'Indices' in 'masked_X/Y Selector': invalid setting in 'masked_X/Y Selector' for parameter 'Indices'.
It looks like I cannot pass the Selector Index as a mask parameter into the referenced model. I suspect this is because the Selector indices (and Input port size) are 'nontunable block parameters'; would that be correct?
I can provide the Index as a parameter in the MATLAB workspace, say p1, but that defeats my purpose of being able to use the single parameter p (with instances p(1), p(2), etc.) to distinguish between multiple instances of the Referenced Model.
Am I doing something obvious wrong or is there a way to select a signal from a vector in a parameterised way within a Referenced Model? Three alternatives I can see are:
- Use a Demux signal outside of the Referenced Model and only take in the selected scalar signal. That means a lot of dead ends from the Demux block, because I may not need to use all individual signals.
- Precede each Referenced Model with its own Selector block. This would double the number of blocks in the overall Simulink model.
- Use a Library block for 'masked_X' instead of a Referenced Model. This works fine, but has some other disadvantages (not able to view scopes inside model without disabling the library link first, etc.).
Any suggestions are welcome, or pleae let me know if any clarification is required.
Best regards,
Gerrit.
2 Kommentare
Penupothula
am 2 Jun. 2023
Hello Gerrit,
I'm also getting this type of error, If you got any solution can you please post it here.
Thank you
Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Model Editing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!