Message Boards Message Boards


Why no graph?

Posted 9 years ago
2 Replies
0 Total Likes
I am studying a basic Mathematica book and I am following examples and cannot get this to plot. I know its a novice question. I am using the Home Edition.

Manipulate[Plot[{Sin[2 Pi/ax], cCos[2 Pi/bx]}, {x, 0, 4 Pi},  PlotStyle -> {GrayLevel[0], GrayLevel[.5]},   PlotRange -> {-4 Pi/2, 4 Pi/2},  AspectRatio -> 1], {{a, 2 Pi, "Period for Sine"}, .1, 4}, {{b, 2 Pi, "Period for Cosine"}, .1, 5}, {{c, 2 Pi, "Amplitude for Cosine"}, .1, 5}]
POSTED BY: Scott Price
2 Replies
Posted 9 years ago
Thanks. That was it. Typing this in can be deceiving because the cursor acted like there was already a space. Obviously not. 
POSTED BY: Scott Price
Posted 9 years ago
Hey Scott,

You either need a multiplication symbol or a space between the expression and the constant you multiply the expression with.  In the code below I inserted spaces.
Plot[{Sin[2 Pi/a x], c Cos[2 Pi/b x]}, {x, 0, 4 Pi},
  PlotStyle -> {GrayLevel[0], GrayLevel[.5]},
  PlotRange -> {-4 Pi/2, 4 Pi/2},
  AspectRatio -> 1], {{a, 2 Pi, "Period for Sine"}, .1,
  4}, {{b, 2 Pi, "Period for Cosine"}, .1,
  5}, {{c, 2 Pi, "Amplitude for Cosine"}, .1, 5}]

Hope it helps.
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
or Discard

Group Abstract Group Abstract