Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ClearAll[f, g, h];
- f[x_] := Piecewise[{{3, 0 < x < 1}, {-3, 1 < x < 2}}]
- g[x_] := f[Mod[x, 2]]
- h[x_] = FourierSeries[g[x], x, 30];
- Show[
- Plot[g[x], {x, -1, 3}, Filling -> Axis],
- Plot[h[x], {x, -1, 3}],
- PlotRange -> {-4, 4}
- ]
- ClearAll[f, g, h, k];
- f[x_] := Piecewise[{{3, 0 < x < 1}, {-3, 1 < x < 2}}]
- g[x_] := f[Mod[x, 2]]
- h[x_] = FourierSeries[g[x], x, 30];
- k[x_] = FourierTrigSeries[g[x], x, 30];
- Show[
- Plot[g[x], {x, -1, 3}, Filling -> Axis],
- Plot[h[x], {x, -1, 3}],
- Plot[k[x], {x, -1, 3}],
- PlotRange -> {-4, 4}
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement