%% Reset the SineWave Signal
% Note: This example runs only in R2016b or later. If you are using an earlier release, replace each call to the function with the equivalent step syntax. For dsp.ColoredNoise System object™, myObject() becomes step(myObject). For all other objects, myObject(x) becomes step(myObject,x).

sine = dsp.SineWave('Amplitude',1,'Frequency',1/4,'SamplesPerFrame',7);

%
% 7 samples of a sine wave with frequency of 1/4 Hz

y = sine();

%
% Call step method without reset

y1 = sine();
stem([y; y1])

%
% y1 is a continuation of y. Now reset

reset(sine);
y2 = sine();

%
% y2 starts at n = 0 and equals y

isequal(y,y2)

% Copyright 2012 The MathWorks, Inc.