I would like to know if you can help me.
I have to get the vector index where its value is closer o nearest to a given value, for example.
i have this vector.
0 1 2 3 4 5 6 7 index
Value -172.0000 | -130.8750 | -89.7500 | -48.6250 | -7.5000 | 33.6250 | 74.7500 | 115.8750 | 157.0000
and if i want to look for the -8, it want to get the index 3 because -8 is between .-48.625 and -7.5, and so on, if i looking for 157, i should get the index 7
i have this code by far, but it isnt working the way i want.
for i=1 :fil
for j=1 :col
for w=1 :numel(recta)
can some one give me an idea please