MathGroup Archive 2010

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

Search the Archive

Re: Two questions related to Arrays

  • To: mathgroup at smc.vnet.net
  • Subject: [mg113325] Re: Two questions related to Arrays
  • From: Bob Hanlon <hanlonr at cox.net>
  • Date: Sat, 23 Oct 2010 07:08:08 -0400 (EDT)

Array is not a Head and does not appear in the FullForm of the expression

{{{1}, {2}}, {3, 4}, {{5}, 6}} // FullForm

Use

Cases[{{{1}, {2}}, {3, 4}, {{5}, 6}}, {{__} ..}]

{{{1}, {2}}}


I don't understand your second question but you should look at MatrixQ

f[t_?MatrixQ] :=


Bob Hanlon

---- Sam Takoy <sam.takoy at yahoo.com> wrote: 

=============
Hi,

First, why doesn't the following return the first two elements of the 
outer list:


Cases[{{{1}, {2}}, {3, 4}, {{5}, 6}}, _Array]



Second, I'm looking for help writing a function

f[t__]:=

that returns Outer[Times, u] where u only includes the input variables 
that are Arrays.


Many thanks in advance,

Sam



  • Prev by Date: Variable number of arguments
  • Next by Date: Re: FunctionQ?
  • Previous by thread: Re: Two questions related to Arrays
  • Next by thread: Re: Two questions related to Arrays