Combination of 2 columns

2 ビュー (過去 30 日間)
Cside
Cside 2020 年 2 月 14 日
回答済み: Stephen23 2020 年 2 月 14 日
Hi, I have 2 vectors, A = 10x1, B = 6x1.
How do I create a 60x2 matrix where every element of A is matched to the element of B? Each row should reflect (A,B). Thanks! :)

採用された回答

Stephen23
Stephen23 2020 年 2 月 14 日
[Am,Bm] = ndgrid(A,B);
M = [Am(:),Bm(:)]

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrices and Arrays についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by