frenzal_dude
- 76
- 0
I want to input the following function so I can find the Fourier Transform of it:
tri(\frac{t}{2\pi })Cos(2\pi (\frac{5}{\pi })t)
I couldn't find a simple way of doing a tri function so this is what I inputted in matlab:
a(t_{1}) = (\frac{t_{1}}{\pi }+1)Cos(2\pi (\frac{5}{\pi })t_{1}) where -π < t1 < 0
b(t_{2}) = (-\frac{t_{2}}{\pi }+1)Cos(2\pi (\frac{5}{\pi })t_{2}) where 0 < t2 < π
g(t) = a(t_{1}) + b(t_{2})
Here is what I typed into matlab:
>> t1 = -pi:0.01:0;
>> t2 = 0:0.01:pi;
>> g = ((t1/pi) + 1)*cos(2*pi*(5/pi)*t1) + ((-t2/pi) + 1)*cos(2*pi*(5/pi)*t2);
But I get this error:
? Error using ==> mtimes
Inner matrix dimensions must agree.
I looked in the workspace and t1 and t2 both have the same dimensions of 1x315 (just different min anad max values).
Thanks for your help.
tri(\frac{t}{2\pi })Cos(2\pi (\frac{5}{\pi })t)
I couldn't find a simple way of doing a tri function so this is what I inputted in matlab:
a(t_{1}) = (\frac{t_{1}}{\pi }+1)Cos(2\pi (\frac{5}{\pi })t_{1}) where -π < t1 < 0
b(t_{2}) = (-\frac{t_{2}}{\pi }+1)Cos(2\pi (\frac{5}{\pi })t_{2}) where 0 < t2 < π
g(t) = a(t_{1}) + b(t_{2})
Here is what I typed into matlab:
>> t1 = -pi:0.01:0;
>> t2 = 0:0.01:pi;
>> g = ((t1/pi) + 1)*cos(2*pi*(5/pi)*t1) + ((-t2/pi) + 1)*cos(2*pi*(5/pi)*t2);
But I get this error:
? Error using ==> mtimes
Inner matrix dimensions must agree.
I looked in the workspace and t1 and t2 both have the same dimensions of 1x315 (just different min anad max values).
Thanks for your help.