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

Jos (10584)
Jos (10584) 2013년 10월 18일
Homework? I suggest you read the help of RESHAPE and TRANSPOSE

댓글을 달려면 로그인하십시오.

 채택된 답변

Azzi Abdelmalek
Azzi Abdelmalek 2013년 10월 18일
편집: Azzi Abdelmalek 2013년 10월 18일

0 개 추천

A=[1 2; 3 4; 5 6; 7 8]
BB=reshape(A',4,[])'

댓글 수: 3

Paranshu
Paranshu 2013년 10월 18일
편집: Azzi Abdelmalek 2013년 10월 18일
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 2013년 10월 18일
편집: Azzi Abdelmalek 2013년 10월 18일
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 2013년 10월 18일
It was really helpfull..thanks

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Andrei Bobrov
Andrei Bobrov 2013년 10월 18일

0 개 추천

reshape(a',size(a))';

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2013년 10월 18일

댓글:

2013년 10월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by