Combination of 2 columns

1 次查看(过去 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 CenterFile Exchange 中查找有关 MATLAB 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by