title: Matlab - Plot doesn't show
body: <p>I have the following function:</p>
  
  <pre><code>function [ rad,it ] = bisect( f,a,b,Eps,it,maxit )
  X=a:0.1:b;
  Y=f(X);
  plot(X,Y);
  title(sprintf('eps=%d',Eps));
  hold on;
  format long e;
  fa=feval(f,a);
  if(abs(fa)&lt;=Eps)
      rad=a;
      return;
  end
  fb=feval(f,b);
  if(abs(fb)&lt;=Eps)
      rad=b;
      return;
  end
  str=sprintf('a= %d b= %d, fa= %d, fb= %d, it= %d',a,b,fa,fb,it);
  disp(str);
  if(fa*fb&gt;0)
      error('Unvalid interval');
  end
  mean=(a+b)/2;
  fmean=feval(f,mean);
  plot(mean,fmean,'--mo');
  if(abs(fmean)&lt;=Eps)
      rad=mean;
      return;
  else
      it=it+1;
      if(it==maxit)
          rad=mean;
          warning('Reached maxit but precision is greater than epsilon');
          return;
      end
      if(fa*fmean&lt;0)
          [rad,it]=bisect(f,a,mean,Eps,it,maxit);
      else
          [rad,it]=bisect(f,mean,b,Eps,it,maxit);
      end
  end
  end
  </code></pre>
  
  <p>The above function is supposed to calculate the root of a function using bisection method and also to plot the function and the intermediate results.</p>
  
  <p>For some reason, it doesn't plot anything now, but was plotting before. I just added <code>figure();</code> before every return statement and removed that again. Now it doesn't plot anymore, even if I close Matlab or restart the system.</p>