Question: How to split a square Matrix

Hi!

I hope everyone is fine. I have a square matrix like the following form
A := Matrix([[10, -1, 2, 0], [-1, 11, -1, 3], [2, -1, 10, -1], [0, 3, -1, 8]]);
How to split A into three matrices D, L and U as:

D:= Matrix([[10, 0, 0, 0], [0, 11, 0, 0], [0, 0, 10, 0], [0, 0, 0, 8]]);
L := Matrix([[0, 0, 0, 0], [-1, 0, 0, 0], [2, -1, 0, 0], [0, 3, -1, 0]]);
U := Matrix([[0, -1, 2, 0], [0, 0, -1, 3], [0, 0, 0, -1], [0, 0, 0, 0]]);

I am waiting for your positive response. Please take care

Please Wait...