How to graphs this gibbs fourier in matlab

715 Views Asked by At

How does one plot $y=|x|$ in MATLAB?

1

There are 1 best solutions below

1
On

What does gibbs/fourier have to do with absolute value? Are you supposed to get its fourier expansion and then plot it against the absolute value function? Because that will exhibit gibbs phenomenon.

If you just want to plot y=abs(x), then just do

x = -10:0.01:10; y = abs(x); plot(x,y)

If you need the fourier expansion, MATLAB is not the way to do it. I would do it by hand analytically or use some symbolic software like MATHEMATICA. But if you use mathematica, then might as well plot in it too. It's easier and you get prettier pictures too.