1)To study different types of non linearity MATLAB program with step by step guide with output:

  • open MATLAB software:
  • click on file—new—model–
  • In model window click on- view—Library browser

 

step1

 

  • In Library browser click on source and select sine wave.. and drag it to workplace of model window

step2

 

  • Then click on signal routing and select BUS Creator: and drag it to workplace of model window

step3

 

Click on Discontinuties and select any one and drag it to workplace of model window

step4

In search box search scope and  drag it to workplace of model window:

step5_scope

Finally connect all nodes  and run the simulation by going to Debug — run to see output on scope double click on scope icon..

 

and arrange blocks as shown in image below.. also see output after pressing Run

Output