필터 지우기
필터 지우기

sorting Matrix in two coum matrix

조회 수: 1 (최근 30일)
Liaquat Ali
Liaquat Ali 2013년 2월 5일
Hallo every body have this matrix as
-4.1060 -0.0020 -4.1060 -0.0010 -4.1090 -0.0010
-3.9950 3.2950 -3.9950 3.2960 -4.0030 3.2930
-3.9940 3.2940 -3.9970 3.2970 -4.0010 3.2940
-4.1060 -0.0020 -4.1080 0 -4.1060 -0.0020
-4.1070 0 -4.1070 -0.0020 -4.1090 -0.0010
-3.9960 3.2930 -3.9970 3.2970 -4.0030 3.2960
-3.9970 3.2930 -4.0010 3.3050 -4.0020 3.2950
-4.1060 -0.0020 -4.1060 0 -4.1080 -0.0010
-4.1070 0 -4.1060 0 -4.1080 0
-3.9860 3.2860 -3.9970 3.2970 -4.0030 3.2950
-3.9950 3.2950 -3.9970 3.2970 -4.0030 3.2950
-4.1060 -0.0010 -4.1060 -0.0010 -4.1070 0
-4.1060 -0.0010 -4.1080 0 -4.1090 0.0010
-3.9980 3.2970 -3.9990 3.2970 -4.0030 3.2950
-3.9950 3.2950 -3.9970 3.2970 -4.0020 3.2950
which can be of any size, now i want to place all the values so that 3rd n 4 th coulm values comes under the end of 1st and 2nd row and so on all other tow pair columns values come under first n 2nd row
  댓글 수: 3
Jan
Jan 2013년 2월 5일
편집: Jan 2013년 2월 5일
This cannot work for a [n x 6] matrix, because the result is not rectangular anymore. What do you want as output for:
x = [1,2,3,4,5,6] ?
Liaquat Ali
Liaquat Ali 2013년 2월 5일
I have matrix like
f =
1 2 3 4 3 2 6 7
1 2 3 4 3 2 6 7
1 2 3 4 3 2 6 7
5 6 7 8 3 2 6 7
9 10 11 12 3 2 6 7
13 14 15 16 3 2 6 7
and i want the result to be f3 =
1 2
1 2
1 2
5 6
9 10
13 14
3 4
3 4
3 4
7 8
11 12
15 16
3 2
3 2
3 2
3 2
3 2
3 2
6 7
6 7
6 7
6 7
6 7
6 7
Thanks man i have already done it, I do not know whether i can post the answer my self or not ..............lols

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

채택된 답변

ChristianW
ChristianW 2013년 2월 5일
reshape([M(:,1:2:end) M(:,2:2:end)],[],2) % M is your Matrix

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multidimensional Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by