Skip to content

Instantly share code, notes, and snippets.

@DiamondLovesYou
Last active September 8, 2016 11:14
Show Gist options
  • Save DiamondLovesYou/310369bea409800bc93da8c70f1cbd76 to your computer and use it in GitHub Desktop.
Save DiamondLovesYou/310369bea409800bc93da8c70f1cbd76 to your computer and use it in GitHub Desktop.

Exercise2_13.m

A = [1 2 3; 4 5 6; 7 8 9.01];
[A2, success, pivots, cond] = Factor(A);

[m,n] = size(A2);
x = zeros(m, 1);

for i = 1:m-1
    b = zeros(m, 1);
    b(i,1) = 1.0;
    
    out = Solve(A2, pivots, b);
    
    x(i, 1) = out(i, 1);
end

disp(x);

Output

Exercise2_13
     9.833333333332664e+01
     3.996666666666396e+02
                         0

diary off
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment