MATLAB: Find accuracy of 0.xx.. using Symsum

accuracycalculateseriessymsum

Hello!
I was given the following series (1 to inf):
((47^(2*n) *(-1)^n)/ Factorial(2*n),1,inf)
Which eventually gives you cos 47 in radians.
I'm trying to find a way to calculate the index number that gives me the cos 47 accuracy of 0.001 (or less), using symsum. (and not with a 'while' loop that checks every iteraion if cos47 minus current series gives me 0.001 or less).
Thank you very much!

Best Answer

For those who find this question later on, I found a solution:
syms n;
a= symsum((47^(2*n)*(-1)^n)/factorial(2*n),0,65);
a=vpa(a,4);
b= symsum((47^(2*n)*(-1)^n)/factorial(2*n),0,66);
b=vpa(a,4);
disp(a-b);
this gives you an accuracy of 0.001.
Related Question