a few questions
- To: mathgroup at smc.vnet.net
- Subject: [mg27884] a few questions
- From: Tomaz Cedilnik <tcedilnik at ntlworld.com>
- Date: Fri, 23 Mar 2001 04:31:05 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
I'm editing some .m files but I currently can't access a working copy of
Mathematica so I need help.
1) Are the funkcions to tell whether the argument is a number/list,
NumberQ and ListQ?
2) How do you get the header ( a[b,c] ---> a ) ?
3) Does Join work like that:
Join[{1,2,3},4,{5},{6,{7,8}},9] -> {1,2,3,4,5,6,{7,8},9}
or do all arguments have to be lists?
4) If I define
f[x_,y_:Null] := g[x,y]
does it work like this:
f[1,2] -> g[1,2]
f[3] -> g[3] ?
5) Which function returns position of the element in the list?
Pos[list,element]?
6) How to replace a sub-list, e.g.:
{a,b,c,d,e,f,g,h} 3 {X,Y,Z} ---> {a,b,X,Y,Z,f,g,h}
7) What are Array, Scan, Function, Take, FoldList, Append, NestList?
My guesses:
Array[f,n] -> {f[1],f[2],...,f[n]}
Scan[f,{a,b,c,d,e}] -> f[a];f[b];f[c];f[d];f[e]
Thank you
Tom
- Follow-Ups:
- Re: a few questions
- From: Jean-Marie THOMAS <jmt@agat.net>
- Re: a few questions