2
$\begingroup$

Suppose I have the following Manipulate function,

Manipulate[Plot[Sin[a x + b], {x, 0, 6}], {a, 1, 4}, {b, 0, 10}]

running this plots the function for given a and b. As follow for example:

enter image description here

for each given a and b I want to show the value of a*b on the same module, so for the example above it would show a*b=10 I wonder how one does that?

$\endgroup$
3
$\begingroup$

enter image description here

Manipulate[
 Grid[{
   {Row[{"a * b = ", a*b}]},
   {Plot[Sin[a x + b], {x, 0, 6}, ImageSize -> 400]}
   }, Spacings -> {1, 1}, Frame -> All],
 {{a, 1, "a"}, 1, 4, 1, Appearance -> "Labeled"},
 {{b, 0, "b"}, 0, 10, 1, Appearance -> "Labeled"},
 TrackedSymbols :> {a, b}]
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.