Hey! For the function geo(r,varargin) i am trying to find the sum of the following
1 + r + r^2 + r^3 + r^4 + … + r^n
where n = nargin.
I have searched and lurked at every corner both here and in the "help" in Matlab, but i found no way of "writing"/"setting up" the geometric series without loops, which is what i am trying to accomplish. Finding the sum i can do, but i cannot find a way to write above series without too much effort. Any ideas? What obvious built-in function am i missing?
Best Answer