HW5-Matlab - subplot(3,1,3) plot(t,real(x), 'r' ,t,imag(x),...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
% Homework 5, Problem 1 clear all close all clc % Problem 1a.) Plot x(t) = 3exp(-2*t)*1(t) t = (-1:0.01:5); jj_minus = find(t<0); jj_plus = find(t>=0); one = zeros(size(t)); one(jj_plus) = ones(size(t(jj_plus))); x = 3*exp(-2*t).*one; subplot(3,1,1) plot(t,x) xlabel( 'time (sec)' ) ylabel( 'x(t)' ) % Problem 1b.) Plot x(t) = exp(-2*t)*sin(3*t)*1(t); x = exp(-2*t).*sin(3*t).*one; subplot(3,1,2) plot(t,x) xlabel( 'time (sec)' ) ylabel( 'x(t)' ) % Problem 1c.) Plot x(t) = exp(-j*3*t)*[1(t)-1(t-3)]; one_shifted = zeros(size(t)); jj3 = find(t>=3); one_shifted(jj3) = ones(size(one_shifted(jj3))); x = exp(-j*3*t).*(one-one_shifted);
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
Background image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: subplot(3,1,3) plot(t,real(x), 'r' ,t,imag(x), 'b--' ) xlabel( 'time (sec)' ) ylabel( 'x(t)' ) legend( 'real(x)' , 'imag(x)' ) orient landscape Homework 5, Problem 1 Plots (1a, 1b, 1c from the top): % HW 5 Prob 4 k.) clear all close all clc t = (-2:0.001:4); jj_minus = find(t&lt;0); jj_plus = find(t&gt;=0 &amp; t&lt;=2); one = zeros(size(t)); one(jj_plus) = ones(size(t(jj_plus))); x = (-4/(pi^2)*t+8/(pi^3)).*one; plot(t,x) title( 'x(t) = x*exp(-2t)*1(t)' ) xlabel( 'time (sec)' ) ylabel( 'Particular solution' ) title( 'Particular Solution Behaviour Over Time' ) PLOTS:...
View Full Document

Page1 / 3

HW5-Matlab - subplot(3,1,3) plot(t,real(x), 'r' ,t,imag(x),...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online