Mathematica 9 is now available
Student Support Forum
-----
Student Support Forum: 'Functions of arrays' topicStudent Support Forum > General > "Functions of arrays"

Next Comment >Help | Reply To Topic
Author Comment/Response
hmmm
08/15/09 1:12pm

Functions can be defined via

f[x1_, x2_] := x1^2 + x2^2

in Mathematica.


But how can I manage it to define a function depending on an array?
I would like to do something like

Array[x,2]
f[x[1]_,x[2]_]:=x[1]^2+x[2]^2

because the length of the array varies in my application.

URL: ,

Subject (listing for 'Functions of arrays')
Author Date Posted
Functions of arrays hmmm 08/15/09 1:12pm
Re: Functions of arrays Mikel 08/16/09 7:18pm
Re: Functions of arrays yehuda ben-s... 08/17/09 02:03am
Re: Re: Functions of arrays hmmm 08/22/09 04:39am
Re: Re: Re: Functions of arrays yehuda ben-s... 08/24/09 02:38am
Re: Re: Re: Functions of arrays hmm 08/24/09 2:25pm
Re: Functions of arrays hmmm 08/25/09 03:28am
Re: Functions of arrays hmmm 08/28/09 04:26am
Next Comment >Help | Reply To Topic