Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1990

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

Search the Archive

Re: Ignorance

  • To: MATHGROUP at
  • Subject: Re: Ignorance
  • From: don at kinghorn.chem.WSU.EDU (Don Kinghorn)
  • Date: Sat, 27 Oct 90 13:40:37 PDT

Begin received message:
 Dear mathgroupers,
I have a function defined like this:
It is probably a bad example of Mathematica programming, but anyway it
does what I want: taking as input a vector it builds an appropriate matrix.
Now it would be interesting if it accepted as input a list of vectors,
giving as result the matrix of the matrices resulting from the analisys of
each element of the input. How must I modified my code? Thank you in
advance for your help.

Riccardo Rigon
(an absolute beginner)
RIGON at iveuncc.bitnet

It looks to me like your code could be greatly simplified as follows;

MatrixB[x_List]:=Table[x/. x[[2]]->x[[2]]+i, {i,0,Floor[ x[[1]]/2 - x[[2]] ]} ]

at least I think this is what you want.

In answer to your question, you can apply functions to lists by using Map.
For example;

Map[ MatrixB, { list1,list2,list3} ]

should do what you want. 

I hope this helps. :-) 

Don Kinghorn
Washing State University
Chemical Physics Dept.
don at

  • Prev by Date: Re: math coprocessors
  • Next by Date: Mathematica on a PC
  • Previous by thread: Re: Logical expressions in Mathematica
  • Next by thread: Mathematica on a PC