MathGroup Archive 2013

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: What is f[1]? Advanced question


On 6/25/13 at 9:14 PM, Anthony.J.Mannucci at jpl.nasa.gov (amannucci)
wrote:

>I have found a Mathematica program with the following construct:
>x[1]=0.1
>x[2]=0.2
>x[3]=0.3

>or Do[x[i]=i/10.,{i,1,3}]

>x is not a function. It is not a list. What is it?

x is a function that you have defined at specific values.

Notice that

In[1]:= x[1] = 0.1;
x[2] = 0.2;
x[3] = 0.3;

In[4]:= DownValues[x]

Out[4]= {HoldPattern[x(1)]:>0.1,HoldPattern[x(2)]:>0.2,HoldPattern[x(3)]:=
>0.3}

and

In[5]:= f[y_] := y^2

In[6]:= DownValues[f]

Out[6]= {HoldPattern[f(y_)]:>y^2}

That is the values for x are stored exactly like the definition
of an expression is what most think of as a function in Mathematica.




  • Prev by Date: Dot or Young Diagram in Wolfram Alpha or Mathematica ?
  • Next by Date: Re: Usage Messages in Mathematica
  • Previous by thread: Dot or Young Diagram in Wolfram Alpha or Mathematica ?
  • Next by thread: What is f[1]? Advanced question