Inserting a row and moving other rows down

30 visualizaciones (últimos 30 días)
Liam Sullivan
Liam Sullivan el 29 de En. de 2020
Comentada: Liam Sullivan el 29 de En. de 2020
I am trying to insert a row of ones as the new 2nd row to my matrix, but i want ot move the other rows down. My matrix is defined as A =
3 7 6 0
8 2 5 0
0 1 9 0

Respuesta aceptada

Ajay Kumar
Ajay Kumar el 29 de En. de 2020
Editada: Ajay Kumar el 29 de En. de 2020
A = [A(1,:);[1,1,1,1];A(2,:);A(3,:)]

Más respuestas (0)

Categorías

Más información sobre Creating and Concatenating Matrices 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