Combining merges in top and sub system: error
1 view (last 30 days)
Show older comments
I'm trying to understand some of the details of the merge block, and it appears there are inconsistent results between using it on the top level and using it in a subsystem. The following diagram has no function other than to help in communication, though its design is similar to something I'm working on.
Running this subsystem as an individual model, I was able to get a valid output even for a condition that did not execute the cases connected to the merge as shown.

But when I insert it as a subsystem and run the same condition as shown

I get the following error:


Based on the error message, I would think that even in the subsystem as an individual system I would get that message as none of the inputs are active. Rather it outputted zero, yet that zero is not passed through to the top system when it is run as a subsystem.
Can anyone explain why this happens? And/or suggest a different way to handle conditional cases that effect various outputs?
Thanks in advance
2 Comments
Rohit Reddy Madasani
on 15 Jul 2016
Edited: Rohit Reddy Madasani
on 15 Jul 2016
Hi Julia,
The likely cause for this error could be due to the following reason:
When you have a hierarchy of merge blocks, the last one is the root-merge. The ones before are non-root. You will receive this error if no block writes to a non-root Merge block.
When you have a three of merge blocks, they all share one single space in memory. If we allow a non-root merge block to be active, but have no writer to it, then this can lead to problems and, in particular, confusing results.
One of the main goals of the simplified mode is to avoid this type of confusing behavior.
Answers (0)
See Also
Categories
Find more on Subsystems in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!