convert column vectors to 2D array

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

Antworten (2)

Azzi Abdelmalek
Azzi Abdelmalek am 2 Okt. 2012
Bearbeitet: Azzi Abdelmalek am 2 Okt. 2012

1 Stimme

a=[1;2;3]
b=[11;12;13]
v=[a'; b'] % vertical concatenation
w=[a b ] % horizontal concatenation
Wayne King
Wayne King am 2 Okt. 2012

0 Stimmen

Also, you can use cat()
x = randn(100,1);
y = randn(100,1);
z = cat(2,x,y);

Kategorien

Gefragt:

am 2 Okt. 2012

Community Treasure Hunt

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

Start Hunting!

Translated by