MathGroup Archive 2007

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

Search the Archive

Re: Scalars Instead of Lists with One Element


Gregory Lypny wrote:
> Yes, I'm trying to reproduce the {.} problem with some regularity.   
> Be that as it may, it's not clear why, when I iterate over {i,  
> 1,...,8} and {j ,1,...,8}, I get tables with dimensions {8, 8, 1}  
> rather than {8, 8}.  That's the cut-and-paste problem.  Sigh.
> 

Gregory,

Table[i*j, {i, 8}, {j, 8}] returns a list with dimensions {8, 8}.  But 
if the expression inside Table returns a single-element list, then the 
table will have dimensions {8, 8, 1}.  Example: Table[{i*j}, {i, 8}, {j, 
8}].  So you could try using

Table[
   First[(complicated expression that returns a single element list)],
   {i, 8}, {j, 8}
]

Szabolcs


  • Prev by Date: Re: Graphics3D exported to pdf
  • Next by Date: Re: Locator 3D
  • Previous by thread: Re: Scalars Instead of Lists with One Element
  • Next by thread: Re: Scalars Instead of Lists with One Element