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

조회 수: 33 (최근 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));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Types에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by