%% Pad Sequence Data to Same Length
% Pad sequence data ready for training.
% Load the sequence data.

s = japaneseVowelsTrainData;

% The preprocessed data contains 270 observations each with 12 sequence features. The length of the observations varies between 7 and 26 time steps.
% Pad the data with zeros to the same length as the longest sequence. The function applies on the right side of the data. Specify the dimension containing the time steps as the padding dimension. For this example, the dimension is 2.

sPad = padsequences(s,2);

% Examine the size of the padded sequences.

size(sPad)

% Copyright 2020 The MathWorks, Inc.