Subsystem with variable number of ports.

6 vues (au cours des 30 derniers jours)
Pedro de Vasconcellos
Pedro de Vasconcellos le 13 Nov 2015
Commenté : Piotr Kluczek le 19 Mar 2021
Hi everyone.
I would like to know how can I create a block with number of ports (input and output) chosen by the user in some mask parameter and this block must be part of a library too.
I was creating all my custom blocks using subsystem blocks. Is it possible to create a subsystem block with these functionalities?
Thank you!
  1 commentaire
Piotr Kluczek
Piotr Kluczek le 19 Mar 2021
Well, this is old, but I thought it deserves at least some answer:
The solution depends on what you want to achieve:
  1. If you want more inputs I assume you have a different block that reacts upon it. So It would be best to use variants: https://www.mathworks.com/help/simulink/slref/variant-subsystems.html
  2. If you do the same operation consider using vector input to Subsystem. Most of standard blocks in Simulink seeing vector input will "multiply" its effect (e.x. 2 dimensional vector will make 2 outputs on integrator)
I love to answer old posts ;)

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Subsystems dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by