Hi all! I have a script for plot data. My script is:
for k=159:100:2048 ix=isfinite(LOGIR(:,k)); x=XMEAN(ix); y=LOGIR(ix,k); idx=[1:14] p=polyfit(x(idx),y(idx),1); yfit=polyval(p,x); figure(k); plot(x(idx),y(idx),'.',x,yfit,'r') gtext(['y=',num2str(p(1)),'x+',num2str(p(2))]) xlabel('airmass') ylabel('logirradiance') print(sprintf('Figure(%d).bmp',k), '-dbmp') end
I want the equation to appear automatically on the graph and not I place each one. Also, I want to create a file which will save the constant term of each equation. How can I do this?
Thank you!
Best Answer