taking 2 columns from two different matrices and making a new 2 column matrix
6 ビュー (過去 30 日間)
古いコメントを表示
help!! I have 2 different matrices a and b with large sample sizes, i need to take the first column from b and put it into the first column in a new matrix c and take the first column from a and put it into column 2 in matrix c ??
I know theres a simple answer to this, its just every bit of info on this topic just shows when there are small sample sizes! any help regarding this topic would be greatly appreciated
0 件のコメント
採用された回答
その他の回答 (1 件)
dpb
2015 年 4 月 27 日
Write it in one step...
c=[b(:,1) a(:,2)];
"... every bit of info on this topic just shows when there are small sample sizes"
Size is totally irrelevant other than the two must be concordant in size in the direction of concatenation (iow, here they must be the same length). An example that demonstrates a principle for a vector length of 3 is just as useful as one of 3 million; just that one can actually visualize the smaller so as a pedagogical tool it is far preferable, in fact.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Creating and Concatenating Matrices についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!