MATLAB: How to find index and matched value in vector

find index value vector

Vector = [ -0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 0.0000 0.0000 -0.0000 -0.0000 -0.0000 -0.0000 0.0000 -0.0000 0.0000 -0.0000 -0.0000 0.0000 -0.3315];
[row,col,v] = find(abs(Vector)>=0.0001)
row =
32
col =
1
v =
1
Index(row) is 32 and v = 1. But true value is -0.3315.
How can I find index and matched value in vector?

Best Answer

>> Vector(row,col)
ans = -0.33150
Or if you do not need the index then you can use logical indexing:
>> Vector(abs(Vector)>=0.0001)
ans = -0.33150