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

 채택된 답변

Ajay Kumar
Ajay Kumar 2020년 1월 29일
편집: Ajay Kumar 2020년 1월 29일

1 개 추천

A = [A(1,:);[1,1,1,1];A(2,:);A(3,:)]

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

태그

질문:

2020년 1월 29일

댓글:

2020년 1월 29일

Community Treasure Hunt

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

Start Hunting!

Translated by