Re: ReplacePart?
- To: mathgroup@smc.vnet.net
- Subject: [mg10580] Re: [mg10480] ReplacePart?
- From: "Dr. Tomás Garza"@smc.vnet.net
- Date: Tue, 20 Jan 1998 16:54:19 -0500
Scott, Try this: gt={{3,5},{{},6},{7,{}},{{},{}},{{},56},{{},3}}; b={a1,a2,a3,a4,a5,a6}; c=Position[gt,{},2] {{2,1}, {3,2}, {4,1}, {4,2}, {5,1}, {6,1}} f{h_List, k_Integer] := ReplacePart[h, b[[k]], c[[k]]]; Fold[f, gt, {1,2,3,4,5,6}] {{3,5}, {a1,6}, {7,a2}, {a3,a4}, {a5,56}, {a6,3}} Good luck, Tomas Garza Mexico City