Path: news.mathworks.com!not-for-mail
From: "Bobby Cheng" <bcheng@mathworks.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: use of matrix repeatedly
Date: Thu, 5 Nov 2009 11:28:19 -0500
Organization: The MathWorks, Inc.
Lines: 32
Message-ID: <hcuuf3$i9k$1@fred.mathworks.com>
References: <10da359e-f86e-496d-b2d4-a171b447d346@h14g2000pri.googlegroups.com> <MPG.255cbf8175b9216e989a5f@news.mathworks.com>
Reply-To: "Bobby Cheng" <bcheng@mathworks.com>
NNTP-Posting-Host: chengb.dhcp.mathworks.com
X-Trace: fred.mathworks.com 1257438499 18740 172.31.44.230 (5 Nov 2009 16:28:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 5 Nov 2009 16:28:19 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5843
X-RFC2646: Format=Flowed; Original
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: news.mathworks.com comp.soft-sys.matlab:582782


What are you going to do with the result? Do you have to form the matrix?
---Bob.

"Loren Shure" <loren.shure@mathworks.com> wrote in message 
news:MPG.255cbf8175b9216e989a5f@news.mathworks.com...
> 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
>