Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function errorOfApprox()
- % errorOfApprox(x, y, f)
- x=[-4:0.1:6];
- y=x./(sqrt(1+x.^2));
- %x=[-6:0.1:3];
- %y=exp(-(x/3)).*cos(x);
- a=polyfit(x,y,5);
- ya=polyval(a,x);
- %plot(x,(y-ya).*100./y);
- plot(x,y,x,ya);
Add Comment
Please, Sign In to add comment