plotFunctions.m 696 B

123456789101112131415161718192021222324
  1. function plotFunctions(path,code,globalPar,cPars,cax,centers)
  2. n=size(centers,1);
  3. cax1=linspace(cax(1),cax(size(cax,1)),1000)';
  4. fv=evaluateCenters(globalPar,cPars,cax1);
  5. for i=1:n
  6. m=max(centers(i,:));
  7. m1=max(fv(i,:));
  8. if m1>m
  9. m=m1;
  10. end
  11. f=figure('visible','off');
  12. plot(cax1,fv(i,:))
  13. hold on
  14. scatter(cax,centers(i,:))
  15. text(500,0.8*m,sprintf('k1=%.2f ml/g*min',60*cPars(i,1)));
  16. text(500,0.7*m,sprintf('BVF=%.2f',cPars(i,2)));
  17. %text(500,0.6*m,sprintf('k2=%f',cPars(i,2)));
  18. hold off
  19. saveas(f,fullfile(path,sprintf('%s_centers%d.png',code,i)))
  20. end