Group Abstract Group Abstract

Message Boards Message Boards

0
|
5.6K Views
|
2 Replies
|
0 Total Likes
View groups...
Share
Share this post:

Evaluate a function when a button is clicked in Manipulate?

POSTED BY: William Taylor
2 Replies
POSTED BY: William Taylor

Sorry to bother I see the error here (forgot the underscores in the function definition) I will have to reformulate my request as this does not work for more complex functions in the context I am using them

Still any suggestions on evaluating two functions using current parameter values in a manipulate would be helpful

test[a_, b_] := a + b;

Manipulate[ myPlot = Plot[Sin[n1 x] + Sin[n2 x], {x, 0, 2 Pi}, PlotRange -> 2], {n1, 1, 20}, {n2, 1, 20},

Row[{Spacer[100], Button["Add n1 and n2", Print[Evaluate[test[n1, n2]]], Method -> "Queued", ImageSize -> 100]}] ]
POSTED BY: William Taylor
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard