Group Abstract Group Abstract

Message Boards Message Boards

0
|
8.9K Views
|
3 Replies
|
1 Total Like
View groups...
Share
Share this post:

Determine the position of the smallest positive number in a list

Posted 11 years ago
POSTED BY: Greg
3 Replies
Posted 11 years ago
Last[Last[Position[list, Min[Select[list, NonNegative]]]]]

for just the value- thanks

POSTED BY: Greg
Position[list, Min[Select[list, NonNegative]]]
POSTED BY: Ilian Gachevski
Posted 11 years ago

Nevermind, solved it.

a = Range[-5, 5, 1] /. x_ /; x < 0.0 -> 999999999
b = Min[a]
position = Last[Last /@ Position[a, _?(# == b &)]]
POSTED BY: Greg
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard