# M1 - plot(t,g(t grid(V Scaling g(t>g(2t%hold...

This preview shows page 1. Sign up to view the full content.

clear t = (-2:0.01:2); % % (I) Define a function f(t) % %f = inline('exp(-t).*cos(2*pi*t)','t') %plot(t,f(t)); grid; %hold on; % (II) Shift f(t) --> f(t-2) % The problem is the function to the left of -2 is shifted right as well. %plot(t,f(t-2),'--'); % % (III) Flip f(t) about t=0 --> f(-2) % %f_flip = inline('exp(t).*cos(-2*pi*t)','t') %plot(t,f_flip(t)); grid; % % % (IV) Creating realizable functions --> truncation % g(t)=f(t)u(t) g = inline('exp(-t).*cos(2*pi*t).*(t>=0)','t') % ^ % | % | % Relational Operation retutns 1 if TRUE % 0 if FALSE % This is equivalent to multiplying by unit step u(t)
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: % plot(t,g(t)); grid; % % (V) Scaling g(t)-->g(2t) % %hold on; %plot(t,g(2*t),'o') % % (VI) Numerical Integration Estimating Signal Energy % %x = inline('exp(-t).*((t>=0)&(t<1))','t'); %plot(t,x(t)) %E_x=sum(x(t).*x(t)*.01) %Using narrow pulses to % approximate x(t) %Result contains 0.1% error % %Using the quad function: quad(f,LL,UL) % %x_squared = inline('exp(-2*t).*((t>=0)&(t<1))','t'); %E_x_quad = quad(x_squared,0,1) %Result contains 0.0026% error...
View Full Document

## This note was uploaded on 02/06/2012 for the course EE 2120 taught by Professor Aravena during the Fall '08 term at LSU.

Ask a homework question - tutors are online