%% Align Two Signals Using the 'truncate' Option
% Invoke the 'truncate' option when calling the alignsignals function.
% Create two signals, X and Y. Y is exactly the same as X, except Y has two leading zeros. Align the two signals, applying the 'truncate' directive.

X = [1 2 3];
Y = [0 0 1 2 3];

[Xa,Ya,D] = alignsignals(X,Y,[],'truncate')

%
% Observe that the output signal Xa has a length of 3, the same length as input signal X.
% In the case where using the 'truncate' option ends up truncating all the original data of X, a warning is issued. To make alignsignals issue such a warning, run the following example.

Y = [0 0 0 0 1 2 3];

[Xa,Ya,D] = alignsignals(X,Y,[],'truncate')

% Copyright 2015 The MathWorks, Inc.