MathGroup Archive 2001

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

Search the Archive

Re: Map

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29703] Re: [mg29684] Map
  • From: Carlos Collier <ccollier at tycho.fciencias.unam.mx>
  • Date: Wed, 4 Jul 2001 03:08:28 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi

You're missing the levelspec in the map function,try this :

Map[If[# < 10, (StringJoin[ToString[0], ToString[#]]), #] &, a, {2}]
                                                               ^^^^
saludos
carlos




On Tue, 3 Jul 2001 bbongiorno at attglobal.net wrote:

> I have not been successful in converting the following If Do routine,
> to a routine using the If Map function.
>
> Matrix
> a={{1,5,10},{25,0,2000},{55,5,2001}}
>
> If Do Routine that works
> y=0;
> Do[y=y+1;x=0;
>   Do[x=x+1;
>    a[[x,y]]=
>      If[a[[x,y]]<10,(StringJoin[ToString[0],ToString[a[[x,y]]]]),a[[x,y]]],
>    {Length[a]}],
>   {Length[Transpose[a]]}]
>
> If Map Routine that does not work
>
> If[# < 10, (StringJoin[ToString[0], ToString[#]]), # ] & /@ a
>
> Please help.
> Thanks,
>
> Benedetto Bongiorno
>
>
>



  • Prev by Date: Re: a problem with differentiation
  • Next by Date: Re: Map
  • Previous by thread: Map
  • Next by thread: Re: Map