Message Boards Message Boards

GROUPS:

[✓] Plot a sawtooth pulse wave?

Posted 9 months ago
759 Views
|
2 Replies
|
2 Total Likes
|

Hello, I am familiar with plotting a regular sawtooth function, but I can seem to figure out how to plot a sawtooth pulse with periods of zero amplitude just like a pulse wave/step response function. I do not see any paameters in the sawtooth function for this. Id greatly appreciate the help. Thanks

2 Replies
Posted 9 months ago

Like this?

Show[Plot[SawtoothWave[x], {x, #[[1]], #[[2]]},
    (*Plot options.*)
    PlotRange -> {{-12, 12}, All},
    ExclusionsStyle -> Dashed(*Plot*)] & /@ {{-2,0.1(*to get the dashes*)}, {1, 5.1}, {9, 10.1}}(*Show*)]

Roll your own?:

sw[x_, a_: 0] := Max[0, Mod[x - a, 1 + a, -a]];
Plot[sw[x, 1], {x, -5, 5}]
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract