Re: setting elements of an array based on a condition
- To: mathgroup at smc.vnet.net
- Subject: [mg87180] Re: setting elements of an array based on a condition
- From: Ray Koopman <koopman at sfu.ca>
- Date: Thu, 3 Apr 2008 05:16:11 -0500 (EST)
- References: <fsvejr$ssp$1@smc.vnet.net>
On Apr 2, 1:03 am, Claus <clausena... at gmail.com> wrote:
> [...]
> 2) Then I want to calculate the sum of the elements in each column of W.
> How can I do this?
> [...]
In[1]:= W = Table[Random[Integer],{4},{5}]
Total@W
Out[1]= {{0,1,1,1,1},
{1,0,1,0,1},
{0,0,1,0,0},
{1,0,1,1,1}}
Out[2]= {2,1,4,2,3}