208l

Version 1.0.0 (1.13 KB) by raam
l
0 Downloads
Updated 15 Nov 2022

View License

%eye(n) for identity matrix
%L\b for inv(L)*b
a=input("enter matrix");
n=length(a);
l=eye(n);
b=input("enter constants:");
%constructing L,U
for i=1:n-1
for j=i+1:n
m=a(j,i)/a(i,i);
l(j,i)=m;
a(j,:)=a(j,:)-m*a(i,:);
end
end
y=l\b;
x=a\y;
disp(x);
%[10,-7,3,5;-6,8,-1,-4;3,1,4,11;5,-9,-2,4;]
%[6;5;2;7]
%[10,8,-3,1;2,10,1,-4;3,-4,10,1;2,2,-3,10;]
%[16;9;10;11;]

Cite As

raam (2024). 208l (https://www.mathworks.com/matlabcentral/fileexchange/120673-208l), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2022b
Compatible with any release
Platform Compatibility
Windows macOS Linux
Tags Add Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes
1.0.0