How to copy pattern from one expression to another?
- To: mathgroup at smc.vnet.net
- Subject: [mg45254] How to copy pattern from one expression to another?
- From: "Nico" <pipponep at hotmail.com>
- Date: Wed, 24 Dec 2003 04:35:55 -0500 (EST)
- Sender: owner-wri-mathgroup at wolfram.com
Hi everyone and Merry Christmas! Here's my issue: I have a vector such as XX={{x11,x12,x13},x2,x3,x4,{x51,x52},x6,{x71,x72},x8} and I would like to apply the same function F[x_] to each single element in it. This is indeed pretty straightforward even to a very basic user like I am: I can first Flatten[XX] and then apply F[Flatten[XX]]. What I get is then YY={F[x11],F[x12],F[x12],...}. The question is: how can I then have YY with the same pattern of XX, that is YY_hat={{F[x11],F[x12],F[x12]},F[x2],....,{F[x51],F[x52]},F[x6],{F..,F}}? I have tried but I'm afraid I cannot focus exactly the way I should approach the problem. Any suggestion anyone? I'd really appreciate it... Kind regards and many thanks! The Net
- Follow-Ups:
- Re: How to copy pattern from one expression to another?
- From: Tomas Garza <tgarza01@prodigy.net.mx>
- Re: How to copy pattern from one expression to another?
- From: Sorasak Danworaphong <Sorasak_Danworaphong@brown.edu>
- Re: How to copy pattern from one expression to another?