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: problem finding a value
Replies: 3   Last Post: Jan 21, 2013 2:26 PM

Advanced Search

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

Posts: 9,850
Registered: 6/7/07
Re: problem finding a value
Posted: Jan 21, 2013 2:26 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

On 1/21/2013 10:06 AM, Iris wrote:
> Hello Josh, thank you for your answer!
> The problem stands...
> imagine that:
> x_x =


> 100.000 -95.340657 -154.28396 2.14672 -326.82169

Fixing format to be legible...

> the 4th (for i = 4) value is inside the range that i want, but then it
> continues for i=5 which is not inside the range... so it will do B...
> how can i do this?

Well, what would be the problem as written (altho I'd likely use CASE
instead of IF here...)

>> for i=1:length(x_x)
if (x_x(i)>-5) & (x_x(i)<2.5)

Looks like exactly what you asked for to me...


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.