Effacer les filtres
Effacer les filtres

Insert zeros into matrix in matlab

2 vues (au cours des 30 derniers jours)
Atreyu91
Atreyu91 le 24 Août 2015
Commenté : Atreyu91 le 25 Août 2015
I am trying to insert zeros into a matrix, an example is as follows:
[1;2]
to
[1;0;0;0;0;2]
Can anyone please show me how to perform this in matlab?
  1 commentaire
Hikaru
Hikaru le 24 Août 2015
Can you be more specific? Do you have any conditions that need to be fulfilled to insert the zeroes?

Connectez-vous pour commenter.

Réponse acceptée

Walter Roberson
Walter Roberson le 24 Août 2015
B = [A(1); zeros(4,1); A(2)];
  1 commentaire
Atreyu91
Atreyu91 le 25 Août 2015
I could not find an example anywhere that put it this simply, thank you!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by