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

129 ビュー (過去 30 日間)
ajk1
ajk1 2015 年 4 月 17 日
編集済み: Guillaume 2015 年 4 月 17 日
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));
  1 件のコメント
ajk1
ajk1 2015 年 4 月 17 日
Thanks Cemil, that worked like a charm.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by