title: How to create if-then logic in simulink?
body: <p>I have a written code and a program in matlab, but I want to do the same think in simulink. I am stuck at the if-then part of the program which I can't figure out.</p>
  
  <p>I tried using the "If" block, but then I didn't know how to say "then alfa=0". After trying to research it I saw many different ways to do conditional statements and now I'm very confused.</p>
  
  <pre><code>if(vb-y(2))*y(3)&lt;0
      alfa=0
  end
  
  if y(3)&lt;zba &amp;&amp; (vb-y(2))*y(3)&gt;=0
      alfa=0
  end
  if zba&lt;y(3) &amp;&amp; y(3)&lt;zmax &amp;&amp; (vb-y(2))*y(3)&gt;=0
      alfa=0.5*(sin(pi*(y(3)-(zmax+zba)/2)/(zmax-zba))+1)
  end
  if zmax&lt;y(3) &amp;&amp; (vb-y(2))*y(3)&gt;=0
      alfa=1
  end
  </code></pre>
  
  <p>I basically need this made in simulink. If someone could just start it out for me or explain the proper way to do this I'd be very thankful.</p>