MathGroup Archive 2004

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

Search the Archive

Re: newbie myHead question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47039] Re: newbie myHead question
  • From: "Bo Le" <bole79 at email.si>
  • Date: Mon, 22 Mar 2004 05:18:51 -0500 (EST)
  • References: <c3h1jj$bc8$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Transpose works with a list.

Why not

myHead[Transpose[m]]

Firtst extract the list, tranpose it and then myHead it.

"János" <janos.lobb at yale.edu> wrote in message news:c3h1jj$bc8$1 at smc.vnet.net...
> I have
>
> m = {{a, b}, {a, b}, {a, b}}
>
> When I apply Transpose to it, I will have
>
> Transpose[m]
>
> {{a, a, a}, {b, b, b}}
>
> The FullForm of it is
>
> List[List[a, a, a], List[b, b, b]]
>
> Now, if I do
>
> n = Apply[myHead, m]
>
> I get
>
> myHead[{a, b}, {a, b}, {a, b}]
>
> If I apply Transpose to it, I get
>
> Transpose[n]
>
> Transpose[myHead[{a, b}, {a, b}, {a, b}]]
>
> The FullForm of it
>
> Transpose[myHead[List[a, b], List[a, b], List[a, b]]]
>
> which is not that I need.  I need
>
> myHead[{a,a,a},{b,b,b}]
>
> or
>
> myHead[List[a, a, a], List[b, b, b]]
>
> What am I missing ?  What should I do to get myHead[{a,a,a},{b,b,b}] ?
>
> Thanks ahead,
>
> János
> -------------------------------------------------
> clear perl code is better than unclear awk code; but NOTHING comes
> close to unclear perl code
> http://www.faqs.org/faqs/computer-lang/awk/faq/
>


  • Prev by Date: Can I make a bulleted list in Mathematica in a method similar to LaTeX or MS Word?
  • Next by Date: Re: newbie myHead question
  • Previous by thread: Re: newbie myHead question
  • Next by thread: Re: newbie myHead question