/span>);

<span class="comment">% plot residuals</span>
novals = 100;
parvals = linspace(-2,2,novals);

errvals_ls = [];
errvals_stoch = [];
errvals_wc = [];
<span class="keyword">for</span> k=1:novals
   errvals_ls = [errvals_ls, norm((A+parvals(k)*B)*x_nom - b)];
   errvals_stoch = [errvals_stoch, norm((A+parvals(k)*B)*x_stoch - b)];
   errvals_wc = [errvals_wc, norm((A+parvals(k)*B)*x_wc - b)];
<span class="keyword">end</span>;

plot(parvals, errvals_ls, <span class="string">'-'</span>, parvals, errvals_