MATLAB: Defining a function that is a summation

defining a functionsummation

Hello, I want to define a matlab function for the following sum: http://i45.tinypic.com/fddkeb.png
I've written the sum part:
syms x k
symsum((-1)^(k-1).*x^k/(k^2), k, 1, 100)
and want to define the function as f(x) = 1 + this sum, but seem to get errors no matter what I do.
Can anyone help with setting up the definition of the function?

Best Answer

syms x k
f = matlabfunction( 1 + symsum((-1)^(k-1).*x^k/(k^2), k, 1, 100) );
Related Question