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