Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. clc; clear;
  2.  
  3. xp=[0.1:0.1:5]
  4. ypc=exp(xp)*2.35
  5. noisegen(0.1,0.1,5)
  6. szum=feval(xp,Noise)
  7. yp=ypc+szum
  8. N=length(xp)
  9.  
  10. w1=0
  11. w2=0
  12. A=1
  13. suma=0
  14.  
  15. for n=1:N
  16. w2=(yp(n)*exp(xp(n)))+w2
  17. w1=exp(2*xp(n))+w1
  18.  
  19. end
  20.  
  21. A=w2/w1
  22.  
  23.  
  24. ypi=A*exp(xp)
  25.  
  26.  
  27.  
  28. for n=1:N
  29. suma=((yp(n)-ypi(n)).^2)+suma
  30. end
  31.  
  32. G=1/N*sqrt(suma)
  33.  
  34. disp(A)
  35. disp(G)
  36.  
  37. plot(xp,yp,xp,ypi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement