Search All of the Math Forum:

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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

 Messages: [ Previous | Next ]
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 23, 2012 5:57 AM

>
> If A is n by 3 and S is an n-vector, then define a selection matrix,
>
> say T, as those rows of an n by n identity matrix for which the
>
> corresponding element of S is 1. Then R = TA contains the
>
> coordinates of the points you want. (Yes, I realize that might be
>
> seen as cheating, because we haven't expressed T as a function of
>
> S using standard operators. If we could, we wouldn't need T!)

Ah, I think that I understand that.
I have to start with S as I have spent various lines defining it, then,
I think I can say :
T ij = 0
Tii = Si
R = TA

Something like that ?
cheers,
Beau