Half of half cycle of sine wave
This can be achieved by taking derivative of the sine function either in matlab code or du/dt block in simulink

grad = diff (sin(x));
if (sin(x)&gt;0 &amp;&amp; grad&gt;0)  
    \\0 to 90 deg
if (sin(x)&gt;0 &amp;&amp; grad&lt;0)
     \\90 to 180 deg
if (sin(x)&lt;0 &amp;&amp; grad&lt;0)
      \\180 to 270 deg
if (sin(x)&gt;0 &amp;&amp; grad&gt;0) 
      \\270 to 360 deg