Re: Adding elements of a matrix
- To: mathgroup at smc.vnet.net
- Subject: [mg40612] Re: [mg40583] Adding elements of a matrix
- From: Sseziwa Mukasa <mukasa at jeol.com>
- Date: Fri, 11 Apr 2003 02:01:43 -0400 (EDT)
- Sender: owner-wri-mathgroup at wolfram.com
On Thursday, April 10, 2003, at 03:42 AM, Rebeca Choy wrote: > Hi, > > How can I add in Mathematica every element of a matrix without adding > twice the mixed terms? > > for example i have a matrix m[[i,j]] and i want to add every term where > i<j (this is to avoiding adding twice the same number) > > Can I do it with Sum? > Yes, Sum[m[[i,j]] ,{j,1,Length[m[[1]]]},{i,1,j-1}] Regards, Ssezi