%               s.t.    a'*x &lt;= b</span>
<span class="comment">% It is also given by P_C(x0) = x0 + (b - a'*x0)*a/||a||^2 if a'*x0 &gt; b</span>
<span class="comment">%                           and x0                         if a'*x0 &lt;=b</span>

<span class="comment">% Input data</span>
randn(<span class="string">'seed'</span>,0);
n  = 10;
a  = randn(n,1);
b  = randn(1);
x0 = randn(n,1);    <span class="comment">% a'*x0 &lt;=b</span>
x1 = x0 + a;        <span class="comment">% a'*x1 &gt; b</span>

<s