Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function x = backSubst ( Z , y , k ) that performs back - substitution recursively to solve Zx = y .

Write a function x = backSubst(Z, y, k) that performs back-substitution recursively to solve Zx = y.(ALLOW one loop) here is example of forward substitution
function y = fwdSubst(L,b,k)
%Foward substitution
[m,n]=size(L);
if ~exist('k')% If first call no k param given, but k=1
k=1;
end
y=b(k)/L(k,k);
if k < n % Recursion step
l =[zeros(k,1);L(k+1:m,k)];
y =[y;fwdSubst(L,b-y*l,k+1)];
end
2. here is already function:
function [A, B]= elimmat(Ag, g)
% Assuming Ag is a square matrix
n = size(Ag,1);
% Initialize elimination matrices
A = eye(n);
B = eye(n);
% Perform elimination
A(:, g)=-Ag(:, g)/ Ag(g, g);
B(:, g)= Ag(:, g)/ Ag(g, g);
end
Write function [L, U]= myLU(A) that reuses elimMat to give an LU factorization of A.
get matrix L and matrix U.(allow one loop)
3. write m-file script to execute program.

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

Students also viewed these Databases questions

Question

Should all businesses have a competitive advantage?

Answered: 1 week ago

Question

Define the term Working Capital Gap.

Answered: 1 week ago