- #1

- 809

- 0

## Main Question or Discussion Point

I would like to use Matlab to check my answers.

For example, I want to find the Fourier transform of [tex] \cos \omega_0 t [/tex].

I know the answer is:

[tex] \pi ( \delta(\omega - \omega_0) + \delta(\omega + \omega_0)) [/tex].

How do I do this in Matlab. All I can find is something like this:

This returns:

I would really like to be able to do something like:

and get:

so I can actually check harder transforms.

How would I do this?

Thanks in advance :)

For example, I want to find the Fourier transform of [tex] \cos \omega_0 t [/tex].

I know the answer is:

[tex] \pi ( \delta(\omega - \omega_0) + \delta(\omega + \omega_0)) [/tex].

How do I do this in Matlab. All I can find is something like this:

Code:

```
clc;
syms t;
fourier(cos(t))
```

Code:

`pi*(dirac(w-1)+dirac(w+1))`

Code:

```
clc;
syms t;
fourier(cos(a*t))
```

Code:

`pi*(dirac(w-a)+dirac(w+a))`

How would I do this?

Thanks in advance :)