Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- clc; clear;
- xp=[0.1:0.1:5]
- ypc=exp(xp)*2.35
- noisegen(0.1,0.1,5)
- szum=feval(xp,Noise)
- yp=ypc+szum
- N=length(xp)
- w1=0
- w2=0
- A=1
- suma=0
- for n=1:N
- w2=(yp(n)*exp(xp(n)))+w2
- w1=exp(2*xp(n))+w1
- end
- A=w2/w1
- ypi=A*exp(xp)
- for n=1:N
- suma=((yp(n)-ypi(n)).^2)+suma
- end
- G=1/N*sqrt(suma)
- disp(A)
- disp(G)
- plot(xp,yp,xp,ypi)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement