Path: news.mathworks.com!not-for-mail
From: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matrix Equation solving
Date: Tue, 20 Nov 2007 01:37:24 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 24
Message-ID: <fhtdoj$g1s$1@fred.mathworks.com>
References: <fhe92r$m23$1@fred.mathworks.com> <fhna35$9u4$1@fred.mathworks.com> <fhsnu5$hg7$1@fred.mathworks.com>
Reply-To: "Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1195522644 16444 172.30.248.37 (20 Nov 2007 01:37:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 20 Nov 2007 01:37:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1187260
Xref: news.mathworks.com comp.soft-sys.matlab:438447


"Roger Stafford" <ellieandrogerxyzzy@mindspring.com.invalid> wrote in 
message <fhsnu5$hg7$1@fred.mathworks.com>...

>   Shameer, I was too lazy Saturday to work out matlab code for 
automatically 
> determining those 81 matrix elements I described as necessary in solving 
> your problem, but now I have done so.  Given your 3 x 3 matrix, A, do this:
> 
>  D = -eye(3);
>  X = repmat(A',3,3);
>  Y = reshape(repmat(reshape(repmat(A.',3,1),1,27),3,1),9,9);
>  Z = X.*Y-eye(9); % Here is the desired 9 x 9 matrix
>  P = reshape(Z\D(:),3,3); % <-- This is the 3 x 3 solution
> .....
------
Here is another alternative that I ought to have thought of before:

 D = -eye(3);
 I = floor((3:11)/3);
 Z = repmat(A',3,3).*A(I,I).'-eye(9);
 P = reshape(Z\D(:),3,3);

Roger Stafford