Wednesday, August 3, 2011

Simulink tricks: multiple plots / two or more inputs on Scope

In the Simulink's scope block, which is commonly used to display the results of the simulation, has only one input port. But sometimes we want to display more than one signal on the same axis. There are several tricks to display multiple plots (two or more inputs) on the Scope.


Trick 1: use Mux block

Use the Mux block from the Signal Routing palette:

to merge two signals in one and connect them to Scope. Here is an example scheme:




Trick 2: use Vector concatenate block

Another solution is to use the Vector Concatenate block from the Signal Routing palette:

This trick will collect all the signals to be displayed, and then to connect the output from the vector concatenate block to the one input port of the Scope. In matrix case, of course, use Matrix concatenate. The example of schematics is presented below:



The result
Simulink will automatically highlight each signal by a different colour, as shown below:

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...