How to change size of array to match size of another array?

124 次查看(过去 30 天)
Hi, I have an array a which is a 1 dimension array (i.e. nx1 array) and I want to create a new array b, which copies the size (nx1) of array a but changes all the elements to 0. I would appreciate help with implementing this.

采纳的回答

Cemil Közkurt
Cemil Közkurt 2015-4-17
编辑:Guillaume 2015-4-17
a=[1:10]' ; % n=10
b=zeros(size(a));

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by