%Homework 2, Problem 2, 4.25(b)
clc; clear all; close all;
\Sigma_{}xmEt W; %symbolic variables t:time, w:frequency
x(t)=1+piecewise(t<-1,_{-},-1<=t<=0,_{-},0<t<=1,_{-},1<t<=2,_{-},2<t<=3, 1,t>3,_{-});
%<-complete blanks in red first before running code.
%PART b
X= int(x,-1,3);
disp('4.25 Part b, X=')
Show completed MATLAB code above + copy/paste result from the Command window:
Solve 4.25 (c) two different ways:
i. by hand
-Using this equation:
$x(t) = \frac{1}{2\pi} \int_{-\infty}^{\infty} X(j\omega)e^{j\omega t} d\omega$
-Find x(0) from graph and plug it in answer:
$x(0) = \frac{1}{2\pi} \int_{-\infty}^{\infty} X(j\omega)d\omega$ or $\int_{-\infty}^{\infty} X(j\omega)d\omega = 2\pi x(0)$
-Type answer below:
Answer: _______ ?