Stefen,
Is this what you want?
deJong[vector_] := Plus @@ (vector^2)
Mapping it onto a list of vectors of varying length...
deJong /@ {{1, 1, 1}, {1, 2, 3, 4}, {a, b}}
{3, 30, a^2 + b^2}
The marvels of Mathematica functional programming!
David Park
XXXX@XXXXX.COM
http://www.**--****.com/ ~djmp/
From: Stefan Schuster
[mailto:bi1169*delete_from_star_to_star*@fh-weihenstephan.de]
Subject: calculate de Jong function
Hello,
I don't know how I should implement the first de jong function:
f(x)=Sum((x_i)^2)
where x is a Vector with n dimensions and x_i is the value of the i-th
Dimension.
i.e. all Values of the Vector are squared and added.
My problem is that I don't know how many Dimensions there are, so I
can't define the borders of the SUM function.
thanks in advance for help
Stefan