Re: Unevaluated values of a[[i]]+b[[j]]
- To: mathgroup at smc.vnet.net
- Subject: [mg65233] Re: Unevaluated values of a[[i]]+b[[j]]
- From: bghiggins at ucdavis.edu
- Date: Sun, 19 Mar 2006 03:19:10 -0500 (EST)
- References: <dvgs5h$9oc$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Alexandre,
Will this do the trick:
a={3,4,4};b={4,3,8};
myfunc[i_]:=HoldForm[{a1*b1,a1+b1,a1/b1,a1-b1}]/.{a1->a[[
i]],b1->b[[i]]}
Map[myfunc[#]&,Range[Length[a]]]
{HoldForm[{3*4, 3 + 4, 3/4, 3 - 4}],
HoldForm[{4*3, 4 + 3, 4/3, 4 - 3}],
HoldForm[{4*8, 4 + 8, 4/8, 4 - 8}]}
When the output is in StandardForm the Holdform is not visible,
Cheers,
Brian