The Math Forum

Search All of the Math Forum:

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

Math Forum » Discussions » Software » comp.soft-sys.matlab

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

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 ]
Bruno Luong

Posts: 9,822
Registered: 7/26/08
Re: Extracting particular row of a matrix based on specific condition
Posted: Jan 2, 2014 1:00 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

dpb <> wrote in message <la3v66$3rm$>...

> Been puzzling over your last comment, Bruno...couldn't decide what you
> meant by "recomputing it". I guess you're speaking of the logical test
> to select nonzero elements instead of just a direct use of the logical
> addressing vector.

Yes, (ib > 0) is identical as t, wht throw it away with "~" ?

> The problem I see with sort() is that I think in the general case the
> results could be jumbled since the two matrices are given independently.
> AFAICT there's no guarantee the magnitude order would be the same as
> the position order in the B array of an arbitrary selection of values in
> the A vector. Or, at least, that's my understanding of the OP's quest...

I don't understand. In my command, sort(ib(t)) returns the indexes in ascending order. Nothing to do with "magnitude".


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.