Search All of the Math Forum:

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

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

Topic: find data within range
Replies: 1   Last Post: Feb 5, 2014 9:12 PM

 Search Thread: Advanced Search

 Messages: [ Previous | Next ]
 Jonathan Allan Posts: 123 Registered: 12/7/04
find data within range
Posted: Feb 5, 2014 7:09 PM
 Plain Text Reply

Hi,

I am trying to find a particular value from one matrix (A), within a second larger matrix (B). I have tried using find, but it frequently comes up empty because the values in my A matrix differ by very small amounts when compared to B. Is there a more efficient way of dealing with something like this. For example...

Elev=1.270; %value of interest
data=[0.945203392800000
0.904372689600000
0.899801604000000
0.912776330400000
1.04941085520000
0.961227033600000
0.995475885600000
1.06582281120000
1.07539840800000
1.17157042800000
1.21405497600000
1.20347384400000
1.21674575040000
0.500000000000000];

If I do r=find(Elev==data), r=[].

In this example, the value I'm shooting for is the second to last in the matrix.
Thanks
Jon

Date Subject Author
2/5/14 Jonathan Allan
2/5/14 dpb

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