How do i manipulate matrix in form given below??

1 2; 3 4; 5 6; 7 8;
as
1 2 3 4; 5 6 7 8;

1 comentario

Jos (10584)
Jos (10584) el 18 de Oct. de 2013
Homework? I suggest you read the help of RESHAPE and TRANSPOSE

Iniciar sesión para comentar.

 Respuesta aceptada

Azzi Abdelmalek
Azzi Abdelmalek el 18 de Oct. de 2013
Editada: Azzi Abdelmalek el 18 de Oct. de 2013
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'

3 comentarios

Paranshu
Paranshu el 18 de Oct. de 2013
Editada: Azzi Abdelmalek el 18 de Oct. de 2013
it should be 2 rather than 4
Even this doesn't solve the problem...it becomes [1 5 2 6; 3 7 4 8] rather it should be [1 2 3 4;5 6 7 8]
Azzi Abdelmalek
Azzi Abdelmalek el 18 de Oct. de 2013
Editada: Azzi Abdelmalek el 18 de Oct. de 2013
Please copy and paste the code
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'
The result
>>BB =
1 2 3 4
5 6 7 8
%or maybe you want this
A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',[],2)'
Paranshu
Paranshu el 18 de Oct. de 2013
It was really helpfull..thanks

Iniciar sesión para comentar.

Más respuestas (1)

Categorías

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