Filter löschen
Filter löschen

Insert zeros into matrix in matlab

1 Ansicht (letzte 30 Tage)
Atreyu91
Atreyu91 am 24 Aug. 2015
Kommentiert: Atreyu91 am 25 Aug. 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 Kommentar
Hikaru
Hikaru am 24 Aug. 2015
Can you be more specific? Do you have any conditions that need to be fulfilled to insert the zeroes?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 24 Aug. 2015
B = [A(1); zeros(4,1); A(2)];
  1 Kommentar
Atreyu91
Atreyu91 am 25 Aug. 2015
I could not find an example anywhere that put it this simply, thank you!

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by