MathGroup Archive 2001

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

Search the Archive

Re: assigning parameters from a matrix


"F cartwright" <flc at ualberta.ca> wrote in message
news:95glkt$8fg at smc.vnet.net...
> Hi. I was hoping someone could help me.
>
> I have a function with 3 parameters, and I want to use a matrix to look at
> the shape of this function in response to specific combinations of the
> parameters (e.g., a = 1, b = 2, c = 3).  I have created a matrix with my
> different sets of parameters and have used the ReadList command to enter
> into Mathematica. What command(s) do I use to apply the function to the
> matrix and look at the different outcomes?  I am having repeated lack of
> success with Map.

Is this what you are after?

In[122]:= f[x_] := x[[1]]+x[[2]]+x[[3]]

In[123]:=data = Table[x*y,{x,5},{y,3}]

Out[123]={{1,2,3},{2,4,6},{3,6,9},{4,8,12},{5,10,15}}

In[124]:=Map[f[#]&,data]

Out[124]={6,12,18,24,30}

If these are not the specifics of your problem or your data, why not post a
specific example?

--
Paul Lutus
www.arachnoid.com





  • Prev by Date: Re: assigning parameters from a matrix
  • Next by Date: Negation versus Exponential
  • Previous by thread: Re: assigning parameters from a matrix
  • Next by thread: Re: assigning parameters from a matrix