How to combine 2 matrices without sorting

I've 2 matrices of size 2048x1. I want to join both the matrices without sorting. I tried using reshape but it automatically is sorting my values. Can someone help with hints or suggestion on this. Thanks in advance

 Respuesta aceptada

Image Analyst
Image Analyst el 16 de Feb. de 2015
Try
matrix2D = [vector1, vector2]; % Creates a 2048 row by 2 column matrix.
or
tallVector = [vector1; vector2]; % Creates a 4096 row by one column vector.

4 comentarios

Bharath
Bharath el 16 de Feb. de 2015
Editada: Bharath el 16 de Feb. de 2015
@image Analyst.Thanks it works.What if I want the second vector to read from last value to first value. Say example.
A= [ 1 2 3 4 5 6]; B= [ 12 34 92 83 23 21];
and I want is
C = [6 5 4 3 2 1 12 34 92 83 23 21]
C = [fliplr(A), B];
Bharath
Bharath el 16 de Feb. de 2015
Thanks that works. I have now the issue with graph. May I'll post it as another question. Can you please look it and suggest me where I'm going wrong.
Image Analyst
Image Analyst el 16 de Feb. de 2015
OK, give me the link to it.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Etiquetas

Preguntada:

el 16 de Feb. de 2015

Comentada:

el 16 de Feb. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by