1

I would like to have a function in Matlab which returns the Fourier transform of the standard mollifier. I have written

syms x
f = exp(1/(x^2-1));
fourier(f)

The problem is, I would like to restrict the domain of that function to -1

syms x
f = exp(1/(x^2-1))&&(-1<x<1);
fourier(f)

though obviously this is incorrect syntax. How can I write this correctly?

  • 1
    You can define your [piecewise](https://mathworks.com/help/symbolic/piecewise.html) function as follows: `f = piecewise(x > -1 & x < 1, exp(1/(x^2-1)), 0);` – m7913d Jun 27 '17 at 09:28
  • 1
    Or you can also use `heaviside` to define a symbolic function within a range – Ander Biguri Jun 27 '17 at 09:47

0 Answers0