zero padding column of data
10 次查看(过去 30 天)
显示 更早的评论
How do I extend an existing matrix (200x1 double) with a specific number of zeros? i.e. pad the end of the column
0 个评论
回答(3 个)
James Tursa
2015-7-24
n = number of elements to pad with 0's
x = your 200 x 1 double array
x(end+1:end+n) = 0;
0 个评论
Star Strider
2015-7-24
Probably the easiest way:
v = rand(200, 1); % Original Vector
Nz = 10; % Number Of Zeros To Pad
v = [v; zeros(Nz,1)]; % Zero-Padded Vector
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Data Type Conversion 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!