Search All of the Math Forum:
Views expressed in these public forums are not endorsed by
Drexel University or The Math Forum.



find data within range
Posted:
Feb 5, 2014 7:09 PM


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



