In the list {1,2,10,9} how do I get the position of the element defined by a variable named gage=10, for example. ( the answer would be 3)
Thanks
It worked now !!!!!! I have tried this way before but didn't work. I don't know what happened.
Thanks Nasser and Priyan
If a use Position[{1,2,10,9},gage] doesn't work
It works for me:
gage = 10; Position[{1, 2, 10, 9}, gage] (* {{3}} *)
OK Priyan, but my doubt is, I don't want to use Position[ {1,2,10,9},10]. I want to use the name of variable, in this case "gage" because it can change during calculations. If a use Position[{1,2,10,9},gage] doesn't work. Thanks for your reply
Use Position function.