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 » Software » comp.soft-sys.matlab

Topic: Extracting particular row of a matrix based on specific condition
Replies: 14   Last Post: Jan 3, 2014 10:03 AM

Advanced Search

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

Posts: 9,242
Registered: 6/7/07
Re: Extracting particular row of a matrix based on specific condition
Posted: Jan 3, 2014 9:59 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/2/2014 1:02 PM, dpb wrote:

> ib returns the absolute value of the row in B where the corresponding
> value from A was found and so is [2 1 0 0] numeric instead of [1 1 0 0]
> logical. Since it isn't a logical array the need to use the logical test
> to only return the nonzero elements but do need to use them as indices,
> not logicals.


OK, Bruno, it finally dawned on me what your comment was -- just a
_little_ slow there!!! :)

Thanks, that makes it even better as you say to not throw away the
logical vector.


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

[Privacy Policy] [Terms of Use]

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