Path: news.mathworks.com!not-for-mail From: "Sean " <sean.dewolski@nospamplease.umit.maine.edu> Newsgroups: comp.soft-sys.matlab Subject: Re: Difficult matrix construction Date: Thu, 7 Oct 2010 17:19:04 +0000 (UTC) Organization: University of Maine Lines: 31 Message-ID: <i8kve8$2f7$1@fred.mathworks.com> References: <i8krvm$dm3$1@fred.mathworks.com> <i8ksro$b5v$1@fred.mathworks.com> <i8kv4t$cr1$1@fred.mathworks.com> Reply-To: "Sean " <sean.dewolski@nospamplease.umit.maine.edu> NNTP-Posting-Host: webapp-02-blr.mathworks.com Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: fred.mathworks.com 1286471944 2535 172.30.248.37 (7 Oct 2010 17:19:04 GMT) X-Complaints-To: news@mathworks.com NNTP-Posting-Date: Thu, 7 Oct 2010 17:19:04 +0000 (UTC) X-Newsreader: MATLAB Central Newsreader 2256903 Xref: news.mathworks.com comp.soft-sys.matlab:676624 "Dennis Belleter" <d.j.w.belleter@student.tue.nl> wrote in message <i8kv4t$cr1$1@fred.mathworks.com>... > "Sean " <sean.dewolski@nospamplease.umit.maine.edu> wrote in message <i8ksro$b5v$1@fred.mathworks.com>... > > "Dennis Belleter" <d.j.w.belleter@student.tue.nl> wrote in message <i8krvm$dm3$1@fred.mathworks.com>... > > > I'm having some trouble designing a MatLab algorithm for the construction of a rather complicated matrix. The marix structure is as follows: > > > > > > | B 0 0 .... 0 | > > > | A*B B 0 .... 0 | > > > | A^2*B A*B B .... 0 | > > > | : : : : : | > > > | A^(N-1)*B A^(N-2)*B A^(N-3)*B .... B | > > > > > > where A and B are matrices as well. > > > > > > I want to construct and use this matrix in an m-file for any arbitrary N. > > > I hope that someone has an algorithm for the construction of this matrix and can help me. > > > > Like this? > > > > n = 4; %Must equal size of both dimensions of A and B > > fancy_mat = B.*tril(A.^toeplitz(0:n-1)); > > Thanks Sean, > > This works brilliant for scalar values, the only problem I have is dat A is a square matrix (2x2) and B is a collum (2x1). > Is it possible to do it in this manner for such a system? > > Kind Regards, > > Dennis It's definitely possible but you didn't illustrate what elements of A go where and same for B.