From: Nehal on
I have a matrix like...

A = [ 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9]

I want to split it like...

B = [1 2 5 6 9
1 2 5 6 9
1 2 5 6 9
1 2 5 6 9
1 2 5 6 9]

C = [3 4 7 8
3 4 7 8
3 4 7 8
3 4 7 8
3 4 7 8]

In my case, I have a huge matrix.. so I want it to be done in a little automatic way...

Like I want to come up with a code that will split a matrix (A) into 2 individual matrix. Where, the 1st matrix (B) will contain all the 1st, 2nd, 5th, 6th, 9th columns. And the 2nd matrix (C) will contain all the 3rd, 4th, 7th, 8th columns of matrix (A).

Can anyone help me..? plz..
From: Matt Fig on
B = A(:,[1 2 5 6 9])
C = A(:[3 4 7 8])

Also, I recommend taking the time to read the "Getting Started" section of the help.
From: Walter Roberson on
Nehal wrote:

> Like I want to come up with a code that will split a matrix (A) into 2
> individual matrix. Where, the 1st matrix (B) will contain all the 1st,
> 2nd, 5th, 6th, 9th columns. And the 2nd matrix (C) will contain all the
> 3rd, 4th, 7th, 8th columns of matrix (A).

B = A(:,[1 2 5 6 9]);
C = A(:,[3 4 7 8]);
From: Nehal on
"Matt Fig" <spamanon(a)yahoo.com> wrote in message <i3f3c5$qtd$1(a)fred.mathworks.com>...
> B = A(:,[1 2 5 6 9])
> C = A(:[3 4 7 8])
>
> Also, I recommend taking the time to read the "Getting Started" section of the help.

Thank You.
And yes, I'll do that too.. :)