| Author |
Comment/Response |
Carlos
|
07/01/08 9:41pm
Hi all,
I am fairly new to Mathematica, so probably I am doing this the wrong way. Anyhow, I just want to define a recursion but I am getting an error message from Mathematica when I do that.
What I am trying to do is to define the evolution of the entries of (sorry for the LaTeX-like code)
x[k+1]= (\Prod _{i=1}^k A[k-i+1]) x[1],
where the vector x has n entries.
My code is (Copy pasted from the command window)
x[i_, k_, n_] := Piecewise[{\!\(
\*UnderoverscriptBox[\(\[Sum]\), \(i = 1\), \(n\)]\(a[i, j,k-1]*
x[i, k - 1, n]\)\), k >= 2}, {X[i, n], k < 2}]
But when I try to see what x[1,1,1] should be (i.e. X[1,1]), I am getting this error message:
x[1, 1, 1]
Sum::itraw: Raw object 1 cannot be used as an iterator. >>
Piecewise::pairs: The first argument {\!\(\*UnderoverscriptBox[\(\
\[Sum]\), \(1 = 1\), \(1\)]\(a[1, j]\ x[1, 1 - 1,
1]\)\),False} of Piecewise is not a list of pairs. >>
Any ideas or suggestions will be more than welcome.
Thanks in advance,
Carlos
URL: , |
|