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: Finding negative array elements then replacing them.
Replies: 5   Last Post: Sep 23, 2011 3:09 PM

Advanced Search

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

Posts: 92
Registered: 8/20/07
Re: Finding negative array elements then replacing them.
Posted: Sep 23, 2011 2:55 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

A = [ -0.76 0.28 -0.31 0.86 0.79]

Alternatively you can simply use this one line without allocating idx to a new array:
A(A<0)=A(A<0)+2*pi;



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.