Guest User

Untitled

a guest
Jul 18th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.21 KB | None | 0 0
  1. function errorOfApprox()
  2. % errorOfApprox(x, y, f)
  3.  
  4. x=[-4:0.1:6];
  5. y=x./(sqrt(1+x.^2));
  6. %x=[-6:0.1:3];
  7. %y=exp(-(x/3)).*cos(x);
  8.  
  9. a=polyfit(x,y,5);
  10. ya=polyval(a,x);
  11.  
  12. %plot(x,(y-ya).*100./y);
  13. plot(x,y,x,ya);
Add Comment
Please, Sign In to add comment