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! :)

 Akzeptierte Antwort

Stephen23
Stephen23 am 14 Feb. 2020

0 Stimmen

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

Weitere Antworten (0)

Kategorien

Mehr zu Discrete Math finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 14 Feb. 2020

Beantwortet:

am 14 Feb. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by