Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2008

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

Search the Archive

Re: Mapping and AppendTo


You can simply use Append.

M = {{0,1,2},{4,5,6,7}};
M = Append[#,8]&/@M;

On Sep 6, 2008, at 2:08 AM, Schettler, Martin wrote:
> Hello--
>
> I would like mix use of Map and AppendTo in the following way (e.g.):
>
> M = {{0,1,2},{4,5,6,7}};
> AppendTo[#,8]&/@M;
>
> Of course, this doesn't work, because {0,1,2} is not a symbol  
> name,etc.
> Is there a way to use Hold or Sow to make this construct work?
>
> Thanks!
>
> M. Schettler



  • Prev by Date: Re: Rearrangement of expression
  • Next by Date: force variable to be real
  • Previous by thread: Mapping and AppendTo
  • Next by thread: Re: Mapping and AppendTo