add new columns to the existing matrix
2 ビュー (過去 30 日間)
古いコメントを表示
I have a 64*63 matrix.now i want to add new column to the end of the all existing 63 columns with all 0 values.i.e I want to make the matrix of 64*64
0 件のコメント
回答 (1 件)
Andrei Bobrov
2013 年 9 月 10 日
編集済み: Andrei Bobrov
2013 年 9 月 10 日
a - your array < 64 x 63 double >
out = [a zeros(size(a,1),1)];
or
a(64,64) = 0;
3 件のコメント
Image Analyst
2013 年 9 月 10 日
However, I'd use
out = [a zeros(size(a,1),1)];
in the first case, to get the number of rows and get rid of the warning message that's produced if you use size(a), which gives a 1x2 array.
参考
カテゴリ
Help Center および File Exchange で Resizing and Reshaping Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!