Path: news.mathworks.com!not-for-mail From: <HIDDEN> Newsgroups: comp.soft-sys.matlab Subject: Re: How can I do Date: Sat, 10 Jan 2009 18:05:03 +0000 (UTC) Organization: The MathWorks, Inc. Lines: 19 Message-ID: <gkao0f$phm$1@fred.mathworks.com> References: <d87c1ea0-d8bb-4d37-9de7-f8923e5b9a79@q30g2000prq.googlegroups.com> Reply-To: <HIDDEN> NNTP-Posting-Host: webapp-03-blr.mathworks.com Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1231610703 26166 172.30.248.38 (10 Jan 2009 18:05:03 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Sat, 10 Jan 2009 18:05:03 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 1187260 Xref: news.mathworks.com comp.soft-sys.matlab:510782 axonmania <murat.gezer@gmail.com> wrote in message <d87c1ea0-d8bb-4d37-9de7-f8923e5b9a79@q30g2000prq.googlegroups.com>... > ....... > I have an Image I read them as 512x512 matrix. and I want made > processing that I will get at first 4096 pieces of 8x8 blocks of them > and after the blocks I want get 4096 pieces 1x64 vectors of the 8x8 > blocks. > ...... Here's another way. Call your original matrix A. Then you can create a matrix B consisting of 4096 columns of 64 elements each, where each of these columns contains the elements from one of the various 8 x 8 blocks in A. m = 8; n = 8; p = 64; q = 64; [I,J,K,L] = ndgrid(1:m,m*p*(0:n-1),m*(0:p-1),m*p*n*(0:q-1)); B = reshape(A(I+J+K+L),m*n,p*q); Is that of any help to you? Roger Stafford