From: Nehal on 5 Aug 2010 15:22 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 5 Aug 2010 15:28 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 5 Aug 2010 15:31 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 5 Aug 2010 15:39 "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.. :)
|
Pages: 1 Prev: Read data from txt Next: Digital Motor Universal Management Relay Simulator |