Path: news.mathworks.com!not-for-mail From: "Bal kishore Pandey" <balkishore.pandey@gmail.com> Newsgroups: comp.soft-sys.matlab Subject: Copy a set of coloumn from one matrix to another. Date: Thu, 10 Nov 2011 18:29:11 +0000 (UTC) Organization: Halmstad university Lines: 14 Message-ID: <j9h55n$qht$1@newscl01ah.mathworks.com> Reply-To: "Bal kishore Pandey" <balkishore.pandey@gmail.com> NNTP-Posting-Host: www-05-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: newscl01ah.mathworks.com 1320949751 27197 172.30.248.37 (10 Nov 2011 18:29:11 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Thu, 10 Nov 2011 18:29:11 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2839546 Xref: news.mathworks.com comp.soft-sys.matlab:749019 Dear friends, Let me explain my situation. I have a two matrix say A and B of same size (i.e) 5000x800. matrix A has some values and matrix B is a zero matrix. Now what i have to do is, i have to set a window of size say 10(10 elemnts of a row), and a window of say size 10 again(coloumn). Now i have to create a program which could copy the first ten elements of coloum 1 according to the size of window coloumn to the matrix B. once copied, it should copy the next 10 elements from the second coloumn(but it should not copy the first 10 elements of the 2nd coloumn, instead it should copy the next 10 elemtents). It should keep on doing this untill the size of window row is reached. Once the row window size is reached it should repeat the copy process of the coloumn. For eg, A= [1 2 3 4 5 6 7 8 9 9 8 7 6 5 4 3 2 1 3 4 5 6 4 5 6 8 9 6 7 8 9 3 4 5 6 7 3 4 6 7 8 9 0 1 2 ] I have this matrix and my coloumn_window_size is 2 and my row_window_size is 3 then the code should copy 1 2(coloumn 1 in A) to B matrix exactly in the same position it was in A. Then it should copy 7 6(coloumn 2) , and then 4 5(coloumn 3) and it should start again from the 4th coloumn copying 6 7 , 6 7