I would like to have 4 output fields for something like the following:
Manipulate[
n*x
n/x
n + x
n - x,
{n, 1, 10}, {x, 1, 10}, ControlType -> InputField]
but this just outputs all 4 calculations combined.
Mathematica Stack Exchange is a question and answer site for users of Wolfram Mathematica. It only takes a minute to sign up.
Sign up to join this communityAs mentioned in the comment by Artes, you can use Row
, although you don't need to put in the "," individually. Row takes a spacing element as its second argument.
Manipulate[Row[{n*x, n/x, n + x, n - x}, ", "],
{n, 1, 10},
{x, 1, 10},
ControlType -> InputField]
You can get much fancier, of course. For example:
Manipulate[Column[{
Row[{"n*x = ", n*x}],
Row[{"n/x = ", n/x,}],
Row[{"n + x = ", n + x}],
Row[{"n - x = ", n - x}]}],
{n, 1, 10},
{x, 1, 10}, ControlType -> InputField]
For the ultimate in layout control, take a look at Grid
.
Manipulate[ Row[{n*x, "," , n/x, ",", n + x ",", n - x}], {n, 1, 10}, {x, 1, 10}, ControlType -> InputField]
$\endgroup$Manipulate
, butCompoundExpression
(and the fact that it is not needed in top level notebook cells) $\endgroup$