Searching vector for precision values
Show older comments
There are many times where I have found myself searching a time vector for a specific time to offset data. Typically I use find(t == d) where d is a specific value which is known to be in t and t is a vector with length > 2000. However, for specific values of d (which I cannot understand) the boolean statement returns a zero vector (d not detected). For Example.
t = 1:1/400:10;
c = 5.465;
d = 5.565;
e = 5.665;
n = find(t == c);
m = find(t == d);
p = find(t == e);
produces n = 1787, m = null double vector, p = 1867.
and t(1827) = 5.5650
Accepted Answer
More Answers (0)
Categories
Find more on Logical in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!