Hi everyone,
I need to know how to individuate the index of an element after a lot of operetion.
For example, having this vectors:
A, vector 200x1
B, vector 50x1
k, vector 30x1 i 'll take the element of k one by one. k[i] is the i-th element!
Q, vector 200x1
and i need to know the index of the element
element=min(abs(abs(abs(k[i]*A[-which(B==B)])-Q[-which(B==B)])-mean(Q)))
i need to know the index of A that give me element!
i tried to use "which" but i don't know how to indicate the element. The only way to do that that i found is:
vector_of element=abs(abs(abs(k[i]*A)-Q)-mean(Q))[-which(B==B)] # vector 1x200 - elements of B (1x50) result vector 1x150
element=min(vector_of_element)
index_element=which(vector_of_element==element)
do you know a way to do that from the previous string?
thank you so much!