Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %Three term Legendre root and co-efficients
- x1 = 0.7745966692
- x2 = 0.0000000000
- x3 = -0.7745966692
- c1 = 0.5555555556
- c2 = 0.8888888889
- c3 = 0.5555555556
- %The integration interval is normalised to -1 to 1
- function y = myFunc(x)
- y = (sin((0.55*x+2.05)/2) - 1)^2;
- endfunction
- approx_integral = c1*myFunc(x1) + c2*myFunc(x2) + c3*myFunc(x3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement