cant find my error, sum of a series

edited September 2011 in Science & Tech
Hey guys, I am new to this forum. I found it while searching google for some answers regarding the problem I am working for Numerical Methods. It is a simple one:

Find the sum of:

(((-1)^n)*(x^2*n))/factorial(2*n)

we are given that x=2 and the series goes from 0 to 100, so all that is left is generate a term vector and type in the code. Here is the code I entered:

>> (((-1).^n)*x.^(2.*n))/factorial(2.*n)

I get an error saying the matrix dimensions must agree, so I am thinking I have a period out of place or something. After playing with it I was able not get an error from inputting:

>> (((-1).^n).*x.^(2.*n))/factorial(2.*n)

but I get this instead:

Warning: Rank deficient, rank = 0, tol = 1.#INFe+000.

ans =

0


I am at a loss as to why it wont just spit my vector out, and the book is of no help. Anyone have any ideas? Would be greatly appreciated! Thanks!

Comments

Sign In or Register to comment.