필터 지우기
필터 지우기

convert column vectors to 2D array

조회 수: 5 (최근 30일)
John
John 2012년 10월 2일
Hello,
If you had two column vectors (2 columns of data) in the workspace, how could you convert this to a 2D array?
Thanks for your help

답변 (2개)

Azzi Abdelmalek
Azzi Abdelmalek 2012년 10월 2일
편집: Azzi Abdelmalek 2012년 10월 2일
a=[1;2;3]
b=[11;12;13]
v=[a'; b'] % vertical concatenation
w=[a b ] % horizontal concatenation

Wayne King
Wayne King 2012년 10월 2일
Also, you can use cat()
x = randn(100,1);
y = randn(100,1);
z = cat(2,x,y);

카테고리

Help CenterFile Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by