How merge block works in simulink?
24 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuestas (1)
Giuseppe Inghilterra
el 21 de Feb. de 2020
For merge block see reference: https://www.mathworks.com/help/simulink/slref/merge.html
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 comentarios
Giuseppe Inghilterra
el 22 de Feb. de 2020
Editada: Giuseppe Inghilterra
el 22 de Feb. de 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.
Ver también
Categorías
Más información sobre Schedule Model Components en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!