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

30 vues (au cours des 30 derniers jours)
ajk1
ajk1 le 17 Avr 2015
Modifié(e) : Guillaume le 17 Avr 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.

Réponse acceptée

Cemil Közkurt
Cemil Közkurt le 17 Avr 2015
Modifié(e) : Guillaume le 17 Avr 2015
a=[1:10]' ; % n=10
b=zeros(size(a));
  1 commentaire
ajk1
ajk1 le 17 Avr 2015
Thanks Cemil, that worked like a charm.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Types dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by