MathGroup Archive 2008

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

Search the Archive

Re: setting elements of an array based on a condition


Claus wrote:
> Hello,
> I have one array, W, which for testing purposes has 25 rows and 50 columns.
> There are two more things I want to accomplish with this:
> 1) I want to set all elements of W which are smaller than zero to zero.

Clip[W, {0, Infinity}]

> 2) Then I want to calculate the sum of the elements in each column of W.
> How can I do this?

Plus @@@ W

or

Total /@ W


  • Prev by Date: Re: setting elements of an array based on a condition
  • Next by Date: Re: Defining a Play[] function for Drawbar Organ Emulation
  • Previous by thread: Re: setting elements of an array based on a condition
  • Next by thread: Re: setting elements of an array based on a condition