how to use Choleski method MATLAB, solve the following linear equations

Register or Login to View the Solution or Ask a Question

Using Choleski method MATLAB, solve the following linear equations

Solution :

>> A=[2 -1 0;-1 2 -1;0 -1 1]
A =

   2  -1   0
  -1   2  -1
   0  -1   1

>> B=[1;0;0]
B =

   1
   0
   0

>> [L,U] = lu(A)
L =

   1.0000        0        0
  -0.5000   1.0000        0
        0  -0.6667   1.0000

U =

   2.0000  -1.0000        0
        0   1.5000  -1.0000
        0        0   0.3333

>> y = L\B
y =

   1.0000
   0.5000
   0.3333

>> x = U\y
x =

   1.0000
   1.0000
   1.0000

thus we found the solution of the linear equations x =1, y =1, z =1

Register or Login to View the Solution or Ask a Question

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply