I am working on a project in linear systems which requires me to do LDU Decomposition on a given 6x6 matrix. For the first part of the project he wants wants this computed fully by hand. What I am having trouble with is the second part where we are meant to be doing it using for-loops in matlab. We are given random 6x6 and 15x15 matrices and asked to find L D U and their inverses in addition to he inverse of our original matrix. "The MATLAB script must find these via row operations computed inside for-loops, you absolutely ma not use inv(), rref(), or other such commands." Can someone give me some basics tips as to where I should begin?
2026-03-27 14:55:39.1774623339
On
LDU Factorization in MatLab
2.6k Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
2
There are 2 best solutions below
0
On
Here are some hints:
Create a matrix:
M = rand(6,6);
Extract the i-th column from this matrix:
c = M(:,i)
Extract the j-th line from this matrix:
v = M(j,:)
Matrix multiply them (kinda like a dot product)
prod = v*c
Get elements from 2 to 6 (end) in the j-th line:
v2 = M(j,2:end)
Hope this helps.
Here