extending columns and rows of matrix
조회 수: 5 (최근 30일)
이전 댓글 표시
Hi I have a matrix like
a=[11 12 113 14
21 22 23 24
31 32 33 34
41 42 43 44]
and I want to extend it to
b=[11 12 13 14 0 0
21 22 23 24 0 0
31 32 33 34 0 0
41 42 43 44 0 0
0 0 0 0 0 0
0 0 0 0 0 0]
how can I do that with a one line command? thank you
댓글 수: 2
Jan
2012년 12월 29일
@ss: Did you see, that there were no linebreaks in your question? I've formatted this, because it was not clear if a and b are vectors or matrices.
채택된 답변
추가 답변 (1개)
Image Analyst
2012년 12월 29일
Try this
a = [a zeros(1, 14)];
댓글 수: 1
Image Analyst
2012년 12월 29일
If you have the Image Processing Toolbox, you might be interested in the padarray() function.
참고 항목
카테고리
Help Center 및 File Exchange에서 Logical에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!