extending columns and rows of matrix
Show older comments
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
Accepted Answer
More Answers (1)
Image Analyst
on 29 Dec 2012
Try this
a = [a zeros(1, 14)];
1 Comment
Image Analyst
on 29 Dec 2012
If you have the Image Processing Toolbox, you might be interested in the padarray() function.
Categories
Find more on Resizing and Reshaping Matrices in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!