Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » sci.math.* » sci.math.num-analysis.independent

Topic: Binary or Logical Selection : Given an array A and a binary or
logical vector S, how do I select the rows of A when S = 1 or True ?

Replies: 6   Last Post: Sep 24, 2012 5:42 AM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Gordon Sande

Posts: 121
Registered: 5/13/10
Re: Binary or Logical Selection : Given an array A and a binary or logical vector S, how do I select the rows of A when S = 1 or True ?
Posted: Sep 22, 2012 6:33 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 2012-09-22 17:13:24 -0300, dr.beauwebber@googlemail.com said:

> Given a 3 column array A of x,y,z numbers, defining a set of spatial
> coordinates, and a binary or logical selection vector S (with as many
> elements as rows in A) :
>
> How do I express the operation of selecting an array R with the set of
> those co-ordinates in A where S is 1 (or true) ?
>
> In Apl I write this as R ? S /[1] A .
>
> But a referee of a paper is asking that I express this in standard
> maths, and I have not yet managed to find an appropriate mathematical
> expression.
> Cheers for any help,
> Beau


Let S be the set of indices you want. The you can talk about its
entries as subscripted
values. To get the rows of A you then needed subscripted subscripts.
The question is where
do you do the colapsing. S does the job!






Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.