MATLAB: Calculate the sum of the following geometric series when N = 1000 and r =1/2 I have searched here and in the “help” in Matlab, but i found nothing about the geometric series

homeworkMATLABno attempt

calculate the sum of the following geometric series when N = 1000 and r =1/2 I have searched here and in the "help" in Matlab, but i found nothing about the geometric series

Best Answer

If your geometric series is a, a*r, a*r^2, ..., a*r^N, then its sum is:
s = a*(1-r^(N+1))/(1-r)