how can make a matrix from many vectors?

how can make a matrix from many vectors?

3 comentarios

sixwwwwww
sixwwwwww el 18 de Oct. de 2013
Are all the vectors of same length?
Azzi Abdelmalek
Azzi Abdelmalek el 18 de Oct. de 2013
You should precise column vectors or row vectors?
fatemeh
fatemeh el 18 de Oct. de 2013
yes row vectors with same size 1*2,actually i have a for loop and it each time produce a vector with size 1*2 ,i want save this vector each time to a matrix

Iniciar sesión para comentar.

Respuestas (3)

vaishali
vaishali el 18 de Oct. de 2013

1 voto

C = horzcat(A1, A2, ...) horizontally concatenates matrices A1, A2, and so on. All matrices in the argument list must have the same number of rows
Jos (10584)
Jos (10584) el 18 de Oct. de 2013
Editada: Jos (10584) el 18 de Oct. de 2013

1 voto

... and if the vectors are not of the same lengths, you can use PADCAT
Azzi Abdelmalek
Azzi Abdelmalek el 18 de Oct. de 2013
out=[A1;A2;A3;...]

1 comentario

Azzi Abdelmalek
Azzi Abdelmalek el 18 de Oct. de 2013
Editada: Azzi Abdelmalek el 18 de Oct. de 2013
out=zeros(1000,2) % Pre-allocate
for k=1:1000
out(k,:)=... % your calculations
end

Iniciar sesión para comentar.

Categorías

Más información sobre Operators and Elementary Operations en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 18 de Oct. de 2013

Comentada:

el 18 de Oct. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by