Example

 

We can test the Relay block with the Colink model shown in the below figure The Sine block is configured to a frequency of 1rad/sec and an amplitude of 1. The Relay block Switch on point is set to 0.001 and Switch off point is set to -0.001. Output when on is set to 1 and Output when off is set to -1. Set solver type to Fixed-Step, discrete (no continuous states), and let End time be 1.

     

Figure 1  colink model

 

Figure 2  A result from scope