Effacer les filtres
Effacer les filtres

Regarding: Creating a subsystem

1 vue (au cours des 30 derniers jours)
Sriharsha
Sriharsha le 11 Fév 2012
Hi,
i have an application where i need to create a subsystem using a GUI.
I have a model with a gain block and a filter block , followed by a scope, where my input is a sine wave.
Now i need to create a subsystem , in which i should include the gain and filter blocks into it (subsystem).
I need to do this using GUI.
The implementation flow is like:
I should select blocks and then i need to click a button on GUI, and then a subsystem should be created in place of blocks.
Can any one please help me in doing this??
Regards
Sriharsha S

Réponse acceptée

TAB
TAB le 13 Fév 2012
In your button callback function, use
% Get the array of handle for selected blocks
blkh=get_param(find_system('YourModel','Selected','on'),'handle');
% Create sybsystem from selected blocks
Simulink.BlockDiagram.createSubSystem(blkh);
As Simulink.BlockDiagram.createSubSystem is not supported in my matlab version, I am not able to test above code, but it should work.
  1 commentaire
Sriharsha
Sriharsha le 13 Fév 2012
Thanks..

Connectez-vous pour commenter.

Plus de réponses (1)

Gagik Hakobyan
Gagik Hakobyan le 11 Fév 2012
Simulink.BlockDiagram.createSubSystem(yourSelectedBlocksList) builds a subsystem from the list of blocks, but i do not know how to get the selected blocks list.
  1 commentaire
Sriharsha
Sriharsha le 13 Fév 2012
Thank You...

Connectez-vous pour commenter.

Catégories

En savoir plus sur Modeling dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by