add column of zeros at end of matrix?

51 次查看(过去 30 天)
I have one matrix that I'm trying to add a column of zeros at the beginning and end of, but so far I can only figure out how to add the column of zeros at the beginning.

回答(1 个)

Walter Roberson
Walter Roberson 2018-10-14
zc = zeros(size(YourMatrix,1),1);
newmatrix = [zc, YourMatrix, zc];

类别

Help CenterFile Exchange 中查找有关 Word games 的更多信息

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by