Re: Two questions related to Arrays
- To: mathgroup at smc.vnet.net
- Subject: [mg113328] Re: Two questions related to Arrays
- From: Sam Takoy <sam.takoy at yahoo.com>
- Date: Sat, 23 Oct 2010 07:08:42 -0400 (EDT)
Thanks for the exhaustive answer! ________________________________ From: Sseziwa Mukasa <mukasa at jeol.com> To: Sam Takoy <sam.takoy at yahoo.com> Cc: mathgroup at smc.vnet.net Sent: Fri, October 22, 2010 9:47:06 AM Subject: [mg113328] Re: [mg113289] Two questions related to Arrays On Oct 22, 2010, at 1:35 AM, Sam Takoy 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] Array is not a head, use ArrayQ yo find arrays. Cases[{{{1}, {2}}, {3, 4}, {{5}, 6}}, _?ArrayQ] > 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. Using the prior idea: f[t__]:=Outer[Times,Sequence@@Cases[t,_?ArrayQ]] Regards, Sseziwa