Re: mathematica
- To: mathgroup at smc.vnet.net
 - Subject: [mg65786] Re: [mg65748] mathematica
 - From: Bob Hanlon <hanlonr at cox.net>
 - Date: Mon, 17 Apr 2006 02:28:44 -0400 (EDT)
 - Reply-to: hanlonr at cox.net
 - Sender: owner-wri-mathgroup at wolfram.com
 
holdPlus[a_List,b_List]:=Module[{f},
        Thread/@Thread[f[a,b]]/.f[x_,y_]:>HoldForm[x+y]]/;
      Dimensions[a]==Dimensions[b];
a={{1,4},{34,5}};
b={{12,4},{4,35}};
holdPlus[a,b]
{{1 + 12, 4 + 4}, {34 + 4, 5 + 35}}
%//ReleaseHold
{{13, 8}, {38, 40}}
Bob Hanlon
> 
> From: liv elena <llivvia2003 at yahoo.com>
To: mathgroup at smc.vnet.net
> Subject: [mg65786] [mg65748] mathematica
> 
> 
> [This post has been delayed due to email problems - moderator]
> 
> 
>    hello,    
>   please help me with this problem
>       
>   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}}    
>       
>   ..    
>   if i use     
>   c = {{StringForm["a[[1,1]]+b[[1,1]]"], StringForm["a[[1,2]]+b[[1,2]]"]},    
>   {StringForm["a[[2,1]]+b[[2,1]]"],    
>   StringForm["a[[2,2]]+b[[2,2]]"]}}    
>   i obtain :    
>   \!\(\*FormBox[    
>     RowBox[{"(", "\[NoBreak]", GridBox[{    
>           {"\<\"a[[1,1]]+b[[1,1]]\"\>", "\<\"a[[1,2]]+b[[1,2]]\"\>"},    
>           {"\<\"a[[2,1]]+b[[2,1]]\"\>", "\<\"a[[2,2]]+b[[2,2]]\"\>"}    
>           }], "\[NoBreak]", ")"}], TraditionalForm]\)    
>       
>   but ai want the numerical values ..    
>   thank you verry much     
>    
> 
> 
>