%% Display Complex-Valued Input Signal
% Create a vector representing a complex-valued sinusoidal signal, and create 
% a |dsp.TimeScope| object. Call the scope to display the signal.

fs = 1000; 
t = (0:1/fs:10)';
CxSine = cos(2*pi*0.2*t) + 1i*sin(2*pi*0.2*t);
CxSineSum = cumsum(CxSine);
scope = dsp.TimeScope(1,fs,'TimeSpanSource','Auto','ShowLegend',1);
scope(CxSineSum);
scope.AxesScaling = 'Auto';
%% 
% By default, when the input is a complex-valued signal, Time Scope plots 
% the real and imaginary portions on the same axes. These real and imaginary portions 
% appear as different-colored lines on the same axes within the same active display.
% 
% Change the |PlotAsMagnitudePhase| property to |true| and call |release|.
%%
scope.PlotAsMagnitudePhase = true;
release(scope)
%% 
% Time Scope now plots the magnitude and phase of the input signal on two 
% separate axes within the same active display. The top axes display magnitude 
% and the bottom axes display the phase, in degrees.

%% 
% Copyright 2012 The MathWorks, Inc.