Path: news.mathworks.com!not-for-mail
From: Loren Shure <loren.shure@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: use of matrix repeatedly
Date: Thu, 5 Nov 2009 10:55:38 -0500
Organization: The MathWorks
Lines: 24
Message-ID: <MPG.255cbf8175b9216e989a5f@news.mathworks.com>
References: <10da359e-f86e-496d-b2d4-a171b447d346@h14g2000pri.googlegroups.com>
NNTP-Posting-Host: shurel.dhcp.mathworks.com
Mime-Version: 1.0
Content-Type: text/plain; charset="iso-8859-15"
Content-Transfer-Encoding: 7bit
X-Trace: fred.mathworks.com 1257436538 16090 172.31.57.214 (5 Nov 2009 15:55:38 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 5 Nov 2009 15:55:38 +0000 (UTC)
User-Agent: MicroPlanet-Gravity/2.70.2067
Xref: news.mathworks.com comp.soft-sys.matlab:582773


In article <10da359e-f86e-496d-b2d4-a171b447d346
@h14g2000pri.googlegroups.com>, munirpansare@gmail.com says...
> hi
> i want to assemble a new matrix in which same submatrix is repeated
> many times.
> for example k=[1,2;2,1]
> if m=1
> ka=[k]
> if m=2
> ka=[k,k;k,k]
> if m=3
> ka=[k,k,k;k,k,k;k,k,k]
> and so on....
> how can i accomplish this task?????
> plz help if possible.
> thanks n regards.
> 

Another poster mentioned repmat.  Maybe you don't even need the full 
array, but to operate with it.  If so, bsxfun might be able to help.

-- 
Loren
http://blogs.mathworks.com/loren