Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // rozwiazanie przy pomocy calki
- wi=[0.1012285362,0.2223810344,0.3137066458,0.3626837833,0.1012285362,0.2223810344,0.3137066458,0.3626837833];
- xi=[0.9602898564,0.7966664774,0.5255324099,0.1834346424,-0.9602898564,-0.7966664774,-0.5255324099,-0.1834346424];
- function d=f(x,y)
- d=abs(x-y);
- endfunction
- suma=0;
- for i=1:8
- for j=1:8
- suma = suma + wi(i)*wi(j)*f(xi(i),xi(j));
- end;
- end;
- disp(suma);
- // rozwiazanie doswiadczalne
- disp([sum(abs((rand(1d6,1)*2-1)-(rand(1d6,1)*2-1)))/1d6])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement