Question

-(10 points) Write a MATLAB program to calculate the sum of first 100 terms of the following series: 1+\left(\frac{1}{3}\right)+\left(\frac{1}{3}\right)^{2}+\left(\frac{1}{3}\right)^{3}+\cdots+\left(\frac{1}{3}\right)^{n}

Fig: 1

Fig: 2