saw - plot(t,x) grid g pause p % METHOD 2 t =...

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

View Full Document Right Arrow Icon
% Uses the fact that between t=-1 and t=+1, the function % x(t) is described simply by the line t which intersects the origin % % METHOD 1 I = linspace(-1,1,200); % these are samples of the line t between -1 and +1 x = [I I I I I]; % concatenate these unity-slope segments to create periodic signal t = linspace(-5,5,length(x)); % form appropriate time vector of same length as x
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: plot(t,x) grid g pause p % METHOD 2 t = linspace(-5,5,1000); x = mod(t+1,2)-1; % the mod function has the effect of "wrapping" the line around plot(t, x) grid g pause p % METHOD 3 (if your particular Matlab installation has the sawtooth % function; type "help sawtooth") % t = linspace(-5,5,1000); plot(t,sawtooth(pi*(t-1))) grid g...
View Full Document

Ask a homework question - tutors are online