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 data within range
Replies: 1   Last Post: Feb 5, 2014 9:12 PM

Advanced Search

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

Posts: 117
Registered: 12/7/04
find data within range
Posted: Feb 5, 2014 7:09 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic 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



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.