If Block and merge block

9 visualizaciones (últimos 30 días)
Luca Luciani
Luca Luciani el 27 de Mzo. de 2018
Respondida: Himanshu el 25 de Oct. de 2024 a las 5:27
Hi, i need some help with If block.I need a block to give me a single output from the if block. I can not use the merge block because it needs all its inputs to be valid, while the if block has only one valid result on at least two possible outputs.

Respuestas (1)

Himanshu
Himanshu el 25 de Oct. de 2024 a las 5:27
Hey Luca,
To achieve the desired functionality, you can use a combination of blocks to ensure that only one valid output is selected from the "If" block:
  • If Block: Use the "If" block to define your conditions and connect it to different subsystems or outputs.
  • Switch Block: Instead of using a "Merge" block, use a "Switch" block or a series of "Switch" blocks. The "Switch" block can be configured to select one of its inputs based on a control signal.
  • Control Logic: Implement logic to determine which output from the "If" block is currently valid. This could be done using additional logic blocks or a custom MATLAB function block.
The can go through the following link to learn more about the switch block:
Hope this helps!

Categorías

Más información sobre Modeling en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by