Borrar filtros
Borrar filtros

Insert zeros into matrix in matlab

2 visualizaciones (últimos 30 días)
Atreyu91
Atreyu91 el 24 de Ag. de 2015
Comentada: Atreyu91 el 25 de Ag. de 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 comentario
Hikaru
Hikaru el 24 de Ag. de 2015
Can you be more specific? Do you have any conditions that need to be fulfilled to insert the zeroes?

Iniciar sesión para comentar.

Respuesta aceptada

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

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by