MATLAB: Can I use a vector as the lower bound index of the summation

sumsymsum

I'm trying to plot the sum of 1/(k-1) from k=s+1 to 100, where s is the independent variable, ranging from 1 to 99. Currently, I have:
s=(1:99);
plot(s, symsum(1/(k-1),s+1,100))
This gives me the following error: Operands to the and && operators must be convertible to logical scalar values.
Error in sym/symsum (line 109) if isnan(a) isnan(b)
Is there a way to do this? Thank you!

Best Answer

t=1:99;
syms s k
y=double(subs(symsum(1/(k-1),s+1,100) ,t) );
plot(t,y)
Related Question