I’m still learning Mathematica. Where do I find documentation on how to use a generalized real-value function as an argument in a function?
The attached notebook is the simplest example I could think of, though it would be a handy tool in itself if it worked. Specific questions are in the comments.
As I said, I’m still learning Mathematica. So where there’s a choice, please use explicit forms of the commands.
As a remark: In your function myPlot the definition of var is not really necessary as it is simply a dummy variable. One way would be using a local variable, another way is to use “formal parameters”, e.g.:
myPlot[f_, a_, b_] := Manipulate[Show[Plot[f[\[FormalX]], {\[FormalX], a, b}],
Graphics[{PointSize[.02], Point[{pnt, f[pnt]}, VertexColors -> Red]}]], {pnt, a, b}]
Edit: … or no specific variable definition at all as this variable is local to Plot.
Thanks, Henrik. Sorry for the delayed gratitude. I had hoped to study up on pure functions before now. It may be the weekend before I do. In the meantime, I want you to know, I appreciate the help. I’ll add to this thread when I get a chance top try out your suggestion.