- #1

- 12

- 0

Second how do I find the LDU factorization of a matrix A? I saw LU and LDL but that was it

thanks Sean

- MATLAB
- Thread starter scsig805
- Start date

- #1

- 12

- 0

Second how do I find the LDU factorization of a matrix A? I saw LU and LDL but that was it

thanks Sean

- #2

- 12

- 0

- #3

- 422

- 1

Try this:Alright I have to questions one is on how to measure the time it takes for my computer to solve a particular code Ive tried the the "tic toc" and that seems to be dependent on the time frame that I typed in tic and toc. I need something that Is only dependent on the time taken to process and solve the command.

Code:

`doc cputime`

Matlab already has LU factorization, so it's easy to transform to LDU factorization. Any textbook on linear algebra will show you how to do this. In case you've forgotten, you can extract the diagonal from a matrix [itex]A[/itex] using the diag command. In Matlab, to look at LDU of a matrix A we would usescsig805 said:Second how do I find the LDU factorization of a matrix A? I saw LU and LDL but that was it

Code:

```
D = diag(diag(A));
LDUA = inv(D) * A;
```

Try looking at the Matlab documentation under Matlab -> Mathematics -> Linear Algebra -> Systems of linear equations for a step-by-step guide, including a discussion of efficiency.

- Last Post

- Replies
- 5

- Views
- 3K

- Last Post

- Replies
- 2

- Views
- 3K

- Last Post

- Replies
- 4

- Views
- 660

- Last Post

- Replies
- 1

- Views
- 2K

- Last Post

- Replies
- 13

- Views
- 11K

- Last Post

- Replies
- 3

- Views
- 2K

- Last Post

- Replies
- 1

- Views
- 3K

- Last Post

- Replies
- 2

- Views
- 5K

- Last Post

- Replies
- 3

- Views
- 3K

- Last Post

- Replies
- 6

- Views
- 3K