%% Return Number of Padded Elements
% You can optionally return the number of elements padded by vec2mat.
% Create a five-element vector and a matrix of padding values.

vec = [1;2;3;4;5];
padding = [2,4;6,4];

% Convert vec to matrices with two, three, and four columns. Specify nonzero padding and return the number padded in each scenario.

[mat2,numPadded2] = vec2mat(vec,2,padding)
[mat3,numPadded3] = vec2mat(vec,3,padding)
[mat4,numPadded4] = vec2mat(vec,4,padding)

% Copyright 2012 The MathWorks, Inc.