Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2006

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

Search the Archive

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}}


  • Prev by Date: Define new constant as Pi is
  • Next by Date: Re: importing a mathematica plot in a latex file
  • Previous by thread: Re: mathematica
  • Next by thread: Re: mathematica