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 日

0 投票

[Am,Bm] = ndgrid(A,B);
M = [Am(:),Bm(:)]

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File Exchange で Discrete Math についてさらに検索

質問済み:

2020 年 2 月 14 日

回答済み:

2020 年 2 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by