do_plot.m 610 B

1234567891011121314151617181920212223242526272829
  1. function ff=do_plot(bins,aux,col,col2)
  2. [curve2, ~] = do_fit(bins,aux);
  3. aux=aux/feval(curve2,0);
  4. [curve2, gof2] = do_fit(bins,aux);
  5. subplot(2,2,1)
  6. p1=plot(curve2);
  7. set(p1,'Color',col2,'LineWidth',2);
  8. hold on;
  9. plot(bins,aux,'Color',col);
  10. legend off;
  11. axis([0 .3 0 1.2])
  12. subplot(2,2,2)
  13. plot(bins,curve2.c.*cos(2*pi*curve2.f.*bins).*exp(-curve2.d.*bins),'Color',col2,'LineWidth',2);
  14. hold on;
  15. plot(bins,aux-feval(curve2,bins)'+curve2.c.*cos(2*pi*curve2.f.*bins).*exp(-curve2.d.*bins),'Color',col);
  16. disp(['freq: ' trunc(curve2.f,3) ' R^{2}: ' trunc(gof2.rsquare,3)]);
  17. ff=curve2.f;
  18. axis([0 .3 -.2 .2])