Path: news.mathworks.com!not-for-mail
From: "Bruno Luong" <b.luong@fogale.findmycountry>
Newsgroups: comp.soft-sys.matlab
Subject: Re: repeating array elements
Date: Sat, 26 Jan 2013 15:40:08 +0000 (UTC)
Organization: FOGALE nanotech
Lines: 6
Message-ID: <ke0tco$kd1$1@newscl01ah.mathworks.com>
References: <63207d27-e8c5-49a1-b1ed-f892f49929dd@googlegroups.com> <1562b2eb-3ea7-49e0-b573-a247304256bf@googlegroups.com>
Reply-To: "Bruno Luong" <b.luong@fogale.findmycountry>
NNTP-Posting-Host: www-01-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: newscl01ah.mathworks.com 1359214808 20897 172.30.248.46 (26 Jan 2013 15:40:08 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 26 Jan 2013 15:40:08 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 390839
Xref: news.mathworks.com comp.soft-sys.matlab:787438

% Another way:

[m n] = size(A);
B = A(repmat(1:m,2,1),repmat(1:n,2,1))

% Bruno