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

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

% 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
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

{[ snackBarMessage ]}

Ask a homework question - tutors are online