Path: news.mathworks.com!not-for-mail
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$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1279561335 270 172.30.248.35 (19 Jul 2010 17:42:15 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 19 Jul 2010 17:42:15 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 2014791
Xref: news.mathworks.com 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.

Emily