Re: mathematica
- To: mathgroup at smc.vnet.net
- Subject: [mg65800] Re: mathematica
- From: "J Siehler" <jsiehler at gmail.com>
- Date: Mon, 17 Apr 2006 02:28:56 -0400 (EDT)
- References: <e1supm$chd$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
liv elena wrote: > ai have the next code : > a = {{1, 4}, {34, 5}} > b = {{12, 4}, {4, 35}} > and ai want to obtain a matrix like this: > rez={{1+12,4+4},{34+4,5+35}} In[1]:= inertPlus[l___]:=HoldForm[Plus[l]] SetAttributes[inertPlus,Listable] In[3]:= a={{1,4},{34,5}}; b={{12,4},{4,35}}; In[5]:= inertPlus[a,b] Out[5]= {{1+12,4+4},{34+4,5+35}} In[6]:= ReleaseHold[%] Out[6]= {{13,8},{38,40}} In[7]:= inertPlus[a,b,a] Out[7]= {{1+12+1,4+4+4},{34+4+34,5+35+5}}