MATLAB: How to load an indexed vector into a symsum

indiciessymsum

I would like to load specific values into the symsum of each step, however it seems like i can't use the index of the sum as an index in my vector.
alpha=[1:100]; %example
syms D t
S1=symsum(alpha(n)*exp(-D*alpha(n)*t),n,1,100);
Error using sym/subsindex (line 836)
Invalid indexing or function
definition. Indexing must follow
MATLAB indexing. Function arguments
must be symbolic variables, and
function body must be sym
expression.
I understand that Matlab see n as a symbol and the cant use it in the alpha(n) vector. How can i circumvent this bump?

Best Answer

Try this:
alpha=1:100;
syms D t n
S1=symsum(alpha.*exp(-D.*alpha.*t),n,1,100);
Related Question