Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

can anyone modify this gauss elim code into LU gauss elimination function [ x ] = GaussElim(a,b) %this function solves a sytem of linear equations

can anyone modify this gauss elim code into LU gauss elimination

function [ x ] = GaussElim(a,b)

%this function solves a sytem of linear equations [a][x]=[b] using the

%Gaussian elimination method

% Input variables:

% a The matrix of coefficients

% b The right-hand side column vector of constants

% Output variable:

% x A column vector with the solution

ab = [a,b];

[R,C] = size(ab);

for j = 1:R-1

for i = j + 1:R

ab(i,j:C) = ab(i,j:C) - ab(i,j)/ab(j,j)*ab(j,j:C);

end

end

x=zeros(R,1);

x(R) = ab(R,C)/ab(R,R);

for i = R - 1:-1:1

x(i) = (ab(i,C) - ab(i,i+1:R)*x(i+1:R))/ab(i,i);

end

please use comment and write clearly

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

What are Measures in OLAP Cubes?

Answered: 1 week ago

Question

How do OLAP Databases provide for Drilling Down into data?

Answered: 1 week ago

Question

How are OLAP Cubes different from Production Relational Databases?

Answered: 1 week ago