Re: Mapping and AppendTo
- To: mathgroup at smc.vnet.net
- Subject: [mg91727] Re: [mg91719] Mapping and AppendTo
- From: Fred Meinberg <fm.administration at gmail.com>
- Date: Sun, 7 Sep 2008 05:31:19 -0400 (EDT)
- References: <g9qimb$4fg$1@smc.vnet.net> <200809051113.HAA11749@smc.vnet.net> <200809060608.CAA19800@smc.vnet.net>
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
- References:
- Re: Magnetic field for a straight conductor with finite length -
- From: Jean-Marc Gulliet <jeanmarc.gulliet@gmail.com>
- Mapping and AppendTo
- From: "Schettler, Martin" <MSchettler@scitor.com>
- Re: Magnetic field for a straight conductor with finite length -