how to attach a matrix generated in loop below a matrix with same row size generated in previous iteration?
1 回表示 (過去 30 日間)
古いコメントを表示
My code is generating a varible with size MxN. I want to attach MxN1 matrix below a MxN2 matrix. So after every loop the variable increases in coloumn.
0 件のコメント
回答 (1 件)
Bjorn Gustavsson
2022 年 8 月 12 日
The "natural" interpretation of below to me would be something like this:
C = [A;B];
But that only works if the number of columns in A and B are the same, that is if
size(A,2) == size(B,2)
But when you write "increases in column" the natural interpretation to me is that you want:
C = [A,B];
which also seem to match what you write about the sizes of the matrices to be concatenated.
HTH
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Loops and Conditional Statements についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!