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

36 visualizaciones (últimos 30 días)
ajk1
ajk1 el 17 de Abr. de 2015
Editada: Guillaume el 17 de Abr. de 2015
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.

Respuesta aceptada

Cemil Közkurt
Cemil Közkurt el 17 de Abr. de 2015
Editada: Guillaume el 17 de Abr. de 2015
a=[1:10]' ; % n=10
b=zeros(size(a));

Más respuestas (0)

Categorías

Más información sobre Data Types en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by