1
$\begingroup$

I have a list that has no definitive pattern or incremental difference. Can I make a Slider go over the items in the list?

For instance, here is an arbitrary list of six elements, can a Slider go from list[[1]] to list[[2]], etc.?

list = {0, 1, 2.22, 5, 141, 299};
$\endgroup$
  • 1
    $\begingroup$ Have you tried anything with a Slider? Take a look at ?Slider, if I understand correctly it can handle what you need. $\endgroup$ – Kuba Aug 4 '16 at 15:06
  • $\begingroup$ Sorry, I read the documentation (reference.wolfram.com/language/ref/Slider.html) and I found nothing that wasn't increment based. I'm sure I missed it. $\endgroup$ – dpholmes Aug 4 '16 at 15:20
  • $\begingroup$ The easiest way is to use a slider for an index to the list, from 1 to Length[list]. $\endgroup$ – Michael E2 Aug 4 '16 at 16:02
7
$\begingroup$

You can achieve this by using both Dynamic and Slider:

{Slider[Dynamic[x], {list}], Dynamic[x]}
|improve this answer|||||
$\endgroup$
6
$\begingroup$

Example

Manipulate[
 i,
 {i, {0, 1, 2.22, 5, 141, 299}, Slider}
]

Output

output

Reference

Manipulate

|improve this answer|||||
$\endgroup$

Not the answer you're looking for? Browse other questions tagged or ask your own question.