What should I do to add a new row and a new column to a matrix?
조회 수: 1 (최근 30일)
이전 댓글 표시
Just ad the title shows, I have a matrix, for example M with the size 3-by-4. The M is [1 2 3 4;5 6 7 8;1 2 3 4]
What should I do if i want to get another matrix ,N like that: [0 0 0 0 0 0; 0 1 2 3 4 0; 0 5 6 7 8 0; 0 1 2 3 4 0; 0 0 0 0 0 0];
댓글 수: 0
채택된 답변
추가 답변 (1개)
Andrei Bobrov
2013년 9월 20일
편집: Andrei Bobrov
2013년 9월 20일
if you have Image Processing Toolbox
N = padarray(M,[1 1]);
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Read, Write, and Modify Image에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!