TransWikia.com

Compact notations for multiple variables

Mathematica Asked on February 6, 2021

Why does this work

Manipulate[ListPlot[{a[1],a[2],a[3]}], {a[1], 0, 1}, {a[2], 0, 1}, {a[3], 0, 1}]

But this doesn’t?

Manipulate[ListPlot[Array[a, 3]], {a[1], 0, 1}, {a[2], 0, 1}, {a[3], 0, 1}]

How do I rewrite this for $3 rightarrow 100$ without typing it out?

One Answer

If I understand your question correctly, you need to inject objects into the Manipulate, e.g.:

With[
    {arr = Array[a,3], control = Sequence@@Thread[{Array[a,3],0,1}]},
    Manipulate[ListPlot[arr],control]
]

enter image description here

Answered by Carl Woll on February 6, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP