 |
How to plot best fit line with polyfit? - MATLAB Answers - MATLAB Central
I modified the example so it works in 2D: x=[9 16 25 49 64 80 ] y=[18.1 22.8 30 47.5 61.2 74] hold on pp = spapi(2,x,y); fnplt(pp) axis([-10,80,-10,80]) plot(get(gca,'XLim'),[0 0],'k'); plot([0 0],get(gca,'YLim'),'k'); X=get(gca,'Xtick'); Y=get(gca,'Ytick
www.mathworks.com |
 |