How merge block works in simulink?

36 vues (au cours des 30 derniers jours)
Skyscrapper
Skyscrapper le 21 Fév 2020
Commenté : Skyscrapper le 4 Mar 2020
Hello everyone,
I need to know what would be the output of the merge block of the attached figure. Will the output be something like that it will give the 7 signals seperately like first 1, then 2,...,and finally 7 or anything else?
Thanks in advance.

Réponses (1)

Giuseppe Inghilterra
Giuseppe Inghilterra le 21 Fév 2020
However, if you try to model as merge_block.jpeg you will get a simulink error because the inputs do not have same dimensions. Merge block does not "merge" dimensions.
Merge block is generally used when you use for example an if action subsystem where depends on an if condition, an if action subsystem is active.
Example:
In above example, when sine wave is greater than zero, then output of merge block is 1, otherwise is 0.
Inputs of merge block have same dimension and data type and the driving signal is the most recently computed. Similar example is by using enable subsystem.
  5 commentaires
Giuseppe Inghilterra
Giuseppe Inghilterra le 22 Fév 2020
Modifié(e) : Giuseppe Inghilterra le 22 Fév 2020
I have tried on my own and you are right. Simulink does not return an error if you allow port unequal port widths from block parameters (this is allowed by simulink if you set "underspecified initialization detection" to "classic" from ConfigurationParameters/Diagnostics/DataValidity/AdvancedParameters).
Now, if you don't specify "Input port offsets" from block parameters, the output of merge block is the maximum size between your mux blocks. Example: if you have two virtual input vector (3x1 and 4x1) the output will be 4x1 vector.
If you specify "Input port offsets" you can obtain several results, depending on your need. In your example v1 has two values and input offset is 0, v2 has four values and input offset is 2, the output v3 will have 6 values.
My example:
v1 has 3 values and offset 1.
v2 has 4 values and offset 6.
I obtain following result:
Thus, final output depends on input size and offset that you set.
Thank you, I discover something new on simulink.
Skyscrapper
Skyscrapper le 4 Mar 2020
Thanks you too for sharing your knowledge!

Connectez-vous pour commenter.

Catégories

En savoir plus sur Simulink Functions 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