My code in Matlab for this practice question is:
(
x = linspace(0,4,10);
y = sqrt(x);
plot(x,y,'-o');
hold on
y2=polyfit(x,y,2);
plot(x,y2,'--or')
)
Is this the best way to do? My plots look nearly identical and are on top of one another but a later question asks to graph the error, so I am...