%i degree for curve fitting
%j is the iterating number for subplot title
x=[1:10]y=sin(x)for i=10:10:100 title([' degree = ' ,num2str(i)]) for j=1:10 subplot(10,1,j) p= polyfit(x,y,i) x2=[1:0.01:10] y2=polyval(p,x2) plot(x,y,'o',x2,y2,'-b') hold on endend
MATLAB: Plot is over plotted
iterating degree of polynomial.
Best Answer