Message Boards Message Boards

0
|
4198 Views
|
4 Replies
|
0 Total Likes
View groups...
Share
Share this post:
GROUPS:

Position of matrice element

Posted 10 years ago

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

4 Replies

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}} *)
POSTED BY: Nasser M. Abbasi

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

Posted 10 years ago

Use Position function.

POSTED BY: Priyan Fernando
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract