BME513Homework1Code

BME513Homework1Code - ) legend( 'x_1(t)' , 'Approximation...

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

View Full Document Right Arrow Icon
%Code for plotting graphs in BME 513 Hwk 1, Problem 1 clear all close all T = 1; t = linspace(0, T, 1000); x1 = ones(size(t)); Approx1 = zeros(size(t)); x2 = cos(2*pi*t); S2 = [-ones(1,250) ones(1,500) -ones(1,250)]; Approx2 = -2/pi*S2; figure plot(t, x1, t, Approx1, '-.' , 'LineWidth' , 2) axis([0 1 -0.5 1.5]) title( 'x_1(t) and its approximation'
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ) legend( 'x_1(t)' , 'Approximation of x_1(t)' ) xlabel( 't' ); ylabel( 'amplitude' );grid on figure plot(t, x2, t, Approx2, '-.' , 'LineWidth' , 2) axis([0 1 -1.5 1.5]) title( 'x_2(t) and its approximation' ) legend( 'x_2(t)' , 'Approximation of x_2(t)' ) xlabel( 't' ); ylabel( 'amplitude' );grid on...
View Full Document

This note was uploaded on 06/08/2009 for the course BME 513 taught by Professor Yen during the Spring '07 term at USC.

Ask a homework question - tutors are online