Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

3
  • $\begingroup$ This looks really nice, however I have an issue (sorry if I didn't explain my question well), func[x] can change from being Cos to Sin from one evaluation to the next. I don't want that to be possible. Specifically, I want a function, func[x_]:=, that becomes one of the functions in listFun, and once it becomes one of those functions it no longer changes. Does that make sense? (I think changing := to = might fix this though?) $\endgroup$ Commented May 22, 2021 at 14:38
  • $\begingroup$ Perhaps another way of saying this is as follows: With the code you have provided ?func gives func[x_] := RandomChoice[listFun][x]. What I want it to be is func[x_]:=Cos[x], or an equivalent version of that (not need to be Cos, I just use Cos as example since that is the first thing you func evaluate to). Then, if I have func1[x_] := RandomChoice[listFun][x], func2[x_] := RandomChoice[listFun][x], func1 might be Sin,Cos, etc, and func2 can possibly be a different one, and so on $\endgroup$ Commented May 22, 2021 at 14:40
  • 1
    $\begingroup$ Yes Set would give a fixed result. That is what Evaluate does in the plots. $\endgroup$ Commented May 22, 2021 at 14:49