From: "Steven Lord" <>
Newsgroups: comp.soft-sys.matlab
Subject: Re: What does this syntax mean
Date: Sun, 17 Jan 2010 22:58:13 -0500
Organization: The MathWorks, Inc.
Lines: 29
Message-ID: <hj0m8i$f9q$>
References: <hiqlta$25v$> <hiqn4j$joj$> <hiqnih$h83$> <hivnv0$nq5$>
Reply-To: "Steven Lord" <>
X-Trace: 1263787090 15674 (18 Jan 2010 03:58:10 GMT)
NNTP-Posting-Date: Mon, 18 Jan 2010 03:58:10 +0000 (UTC)
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2900.5512
X-RFC2646: Format=Flowed; Response
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579
Xref: comp.soft-sys.matlab:599505

"Ender " <> wrote in message 
> MATLAB does not give me the same answer that is in the back of the 
> Numerical Analysis book that I am using. The Matrix A is:
> A=[0,2,-1;1,-1,2;1,-1,4]
> The answer is:
> L = [1,0,0;1.5,1,0;1.5,1,1] & U = [2,-1,1;0,4.5,7.5;0,0,-4]
> When using the MATLAb LU Factorization code [L,U] = lu(A)
> I do not get this answer. I don't know why.

When I use LU in MATLAB, I too receive a different answer than the one you 
cited above.  When I check the output of the LU call in MATLAB (by computing 
L*U) I receive your original matrix.  When I check the product of the two 
matrices you gave above, I do not receive your original matrix.

It's entirely possible that your numerical analysis textbook may have the 
wrong answer, or it could be that you read the answer to the wrong problem.

Steve Lord
comp.soft-sys.matlab (CSSM) FAQ: