From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Blockwise Matrix Expansion
Date: Mon, 19 Jul 2010 17:42:15 +0000 (UTC)
Organization: Duke University
Lines: 15
Message-ID: <i222pn$8e$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: 1279561335 270 (19 Jul 2010 17:42:15 GMT)
NNTP-Posting-Date: Mon, 19 Jul 2010 17:42:15 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2014791
Xref: comp.soft-sys.matlab:654267

Hi all,

I have a matrix that I need to expand in the following way: Each element of the original matrix has to form a block in the new matrix. For instance, if I have

A = [a b; c d]

then I want to create

B = [a a b b; a a b b; c c d d; c c d d]

This would be easy to do with a 2x2 matrix; however, while A is always a square matrix its size is variable, so that I cannot just pick elements in a pre-specified manner. 

I'l be really grateful for any suggestions.