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: find position in a vector
Replies: 3   Last Post: Jul 22, 2013 12:52 PM

Advanced Search

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

Posts: 17
Registered: 7/29/12
find position in a vector
Posted: Jul 22, 2013 11:56 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hello there,

I have a vector of



>> x = [200;500;400;480;900;560;820;0]

I want to have a vector Y that x > 200. So I wrote

>> y = x(x > x(1))

So I get "500 400 480 900 560 820"

It returns me a value. But I need to know a position e.g.

I need the return of y = [2 3 4 5 6] not y = [ 500 400 480 900 560 820];

How should I do in this case? It is quite simple but I really have no idea.

Thank you

AV.



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.