Consider the following piece of code
dbh_m := 100*dbh
Manipulate[
Graphics3D[{Sphere[{0.5, 0.5, 0.5}, Sin[dbh]]},
PlotRange -> {{0, 1}, {0, 1}, {0, 1}}], {dbh, 0, 1}
]
What it does is to plot a 3D sphere of variable radius. If now I modify it like this
dbh_m := 100*dbh
Manipulate[
Graphics3D[{Sphere[{0.5, 0.5, 0.5}, Sin[dbh_m]]},
PlotRange -> {{0, 1}, {0, 1}, {0, 1}}], {dbh, 0, 1}
]
It stops working. So my question is, is there a way to let Manipulate know of the "outer context". Or in other terms can I make manipulate interpret the variables?
dbhinside the manipulate is actually a local symbol, sodbhM(you really should avoid underscores in variable names!) doesn't 'see' manipulate'sdbh(which actually becomesdbh$123213or something locally). What you should do is definedbhM[dbh_]:=100*dbhand then plot...Sin[dbhM[dbh]]...inside the manipulate. You might be interested in this post about scoping constructs – N.J.Evans Oct 18 '17 at 12:33dbh_mname which is a beginner mistake. Let me know if you disagree with closing. – Kuba Oct 18 '17 at 12:47