Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2013

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

Search the Archive

Re: What is f[1]? Advanced question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg131315] Re: What is f[1]? Advanced question
  • From: Bill Rowe <readnews at sbcglobal.net>
  • Date: Thu, 27 Jun 2013 06:32:35 -0400 (EDT)
  • Delivered-to: l-mathgroup@mail-archive0.wolfram.com
  • Delivered-to: l-mathgroup@wolfram.com
  • Delivered-to: mathgroup-outx@smc.vnet.net
  • Delivered-to: mathgroup-newsendx@smc.vnet.net

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