Advertisement
UF6

EAS 501-01 Homework I

UF6
Oct 16th, 2020
2,185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.33 KB | None | 0 0
  1. %%%This is for part a for problem 1.
  2.     A=zeros(8,8);
  3.     for j=1:8
  4.     for k=1:8
  5.     if j==k
  6.     A(j,k)=-2;
  7.     end
  8.     if abs(j-k)==1
  9.     A(j,k)=1;
  10.     end
  11.     end
  12.     end
  13.     [L,U]=lu(A) %%%Proving L and U.
  14.     L*U %%%Proving that L*U=A, thus it is correct.
  15.     %%% This is for part b for problem 1.
  16.     det(U)
  17.     det(A)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement