Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub
↵
Jump to
↵
In this user
All GitHub
↵
Jump to
↵
In this repository
All GitHub
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
adc12012
/
ME3255S2017
Public
forked from
sed12008/ME3255S2017
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
0
Security
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security
Insights
Files
46f626e
HW1
HW2
HW3
HW4
extra_credit_1
lecture_01
lecture_02
lecture_03
lecture_04
lecture_05
lecture_06
lecture_07
lecture_08
lecture_09
lecture_10
lecture_11
lecture_11_files
LU_naive.m
LU_pivot.m
lecture_11.aux
lecture_11.bbl
lecture_11.blg
lecture_11.ipynb
lecture_11.log
lecture_11.out
lecture_11.pdf
lecture_11.tex
mass_springs.png
mass_springs.svg
nohup.out
octave-workspace
linear_algebra
README.md
Breadcrumbs
ME3255S2017
/
lecture_11
/
LU_naive.m
Blame
Blame
Latest commit
History
History
27 lines (27 loc) · 640 Bytes
Breadcrumbs
ME3255S2017
/
lecture_11
/
LU_naive.m
Top
File metadata and controls
Code
Blame
27 lines (27 loc) · 640 Bytes
Raw
function [L, U] = LU_naive(A) % GaussNaive: naive Gauss elimination % x = GaussNaive(A,b): Gauss elimination without pivoting. % input: % A = coefficient matrix % y = right hand side vector % output: % x = solution vector [m,n] = size(A); if m~=n, error('Matrix A must be square'); end nb = n; L=diag(ones(n,1)); U=A; % forward elimination for k = 1:n-1 for i = k+1:n fik = U(i,k)/U(k,k); L(i,k)=fik; U(i,k:nb) = U(i,k:nb)-fik*U(k,k:nb); end end %% back substitution %x = zeros(n,1); %x(n) = Aug(n,nb)/Aug(n,n); %for i = n-1:-1:1 % x(i) = (Aug(i,nb)-Aug(i,i+1:n)*x(i+1:n))/Aug(i,i); %end
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
You can’t perform that action at this time.