Re: Scalars Instead of Lists with One Element
- To: mathgroup at smc.vnet.net
- Subject: [mg83510] Re: Scalars Instead of Lists with One Element
- From: Szabolcs Horvát <szhorvat at gmail.com>
- Date: Wed, 21 Nov 2007 06:00:51 -0500 (EST)
- References: <200711200846.DAA07103@smc.vnet.net> <FFDD2258-D07B-4A08-9A25-2203E647669B@jeol.com> <fi0npe$5h4$1@smc.vnet.net>
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
- References:
- Scalars Instead of Lists with One Element
- From: Gregory Lypny <gregory.lypny@videotron.ca>
- Scalars Instead of Lists with One Element