Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function sum = TaylorCos(x) factorial = 1; coeff = 1; xpower = 1; term = coeff*xpower/factorial; sum = 0; n = 0; while sum ∼= sum + term sum = sum + term; n = n + 1; coeff = -coeff; xpower = xpower*xˆ2; factorial = factorial*(2*n-1)*(2*n); term = coeff*xpower/factorial; end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement