How to display 3 different trace colors on scope (one output) for the merger funtion with three inputs?

1 view (last 30 days)
I am simulating the IF,ELSE IF,ELSE and IF ACTION library identities. The three results are Merged and displayed on the scope with 3 traces of just one color. How can I set the distinct color for each of the 3 traces on the scope? Is it possible?

Answers (1)

Ayush
Ayush on 13 Sep 2023
Edited: Ayush on 13 Sep 2023
Hi Durand,
I understand that you want to display different colors for 3 different traces on the scope block from a merged signal.
I am assuming that by “results are merged” you mean you have used the “Merge” block to merge the three results into one. This would result in a unified signal which cannot be bifurcated into different signals for the “Scope” block to display. Please refer to the below documentation to know more about the “Merge” block: https://www.mathworks.com/help/simulink/slref/merge.htmlsearchHighlight=merge&s_tid=srchtitle_support_results_1_merge
Here are some possible workarounds:
1. MUX Block: Using the Mux” block you can combine the three results into a single virtual vector which can then be represented by the “Scope” block in three different colors automatically. Please refer to the below documentation to know more about the “Mux” block: https://www.mathworks.com/help/simulink/slref/mux.htmlsearchHighlight=mux&s_tid=srchtitle_support_results_1_mux
2. Bus Creator Block: Using the “Bus Creator block, can also be an efficient way to handle the three resulting signals, since it provides greater flexibility in accommodating different data types. Please refer to the below documentation to know more about the “Bus Creator” block: https://www.mathworks.com/help/simulink/slref/buscreator.htmlsearchHighlight=bus%20creator&s_tid=srchtitle_support_results_1_bus%20creator
3. Directly input into the scope: The “Scope” block can also take multiple inputs which would correspond to the three different traces and automatically assigning them different colors.
I hope it helps,
Regards,
Ayush Misra

Products


Release

R2022a

Community Treasure Hunt

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

Start Hunting!