Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. %Three term Legendre root and co-efficients
  2. x1 = 0.7745966692
  3. x2 = 0.0000000000
  4. x3 = -0.7745966692
  5. c1 = 0.5555555556
  6. c2 = 0.8888888889
  7. c3 = 0.5555555556
  8.  
  9. %The integration interval is normalised to -1 to 1
  10. function y = myFunc(x)
  11. y = (sin((0.55*x+2.05)/2) - 1)^2;
  12. endfunction
  13.  
  14. approx_integral = c1*myFunc(x1) + c2*myFunc(x2) + c3*myFunc(x3)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement