Effacer les filtres
Effacer les filtres

convert column vectors to 2D array

5 vues (au cours des 30 derniers jours)
John
John le 2 Oct 2012
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

Réponses (2)

Azzi Abdelmalek
Azzi Abdelmalek le 2 Oct 2012
Modifié(e) : Azzi Abdelmalek le 2 Oct 2012
a=[1;2;3]
b=[11;12;13]
v=[a'; b'] % vertical concatenation
w=[a b ] % horizontal concatenation

Wayne King
Wayne King le 2 Oct 2012
Also, you can use cat()
x = randn(100,1);
y = randn(100,1);
z = cat(2,x,y);

Catégories

En savoir plus sur Creating and Concatenating Matrices dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by