AMATH 301 Lecture 7: LU Decomposition and Timing Code in MATLAB

68 views3 pages
21 Jan 2018
School
Course

Document Summary

Lu composition code example - to use in homework, tests 2. %to solve this system, the worst case scenario is that each equation. %takes around n-1 flops + 1 flop to divide out at the end for a total of. %n flops per equations, meaning total number to solve everything is. %lower triangular = l, upper triangular = u. %ly = b (we can solve this with simple substitution), and then ux = y is. %lu = pa is how matlab wants to solve the problem. %matrix that looks like the identity matrix but is mixed up. Lecture 7 notes a = [2 1 1; %backslash solves a system of equations quickly x = a\b; %[l,u,p] = lu(a) returns unit lower triangular matrix l, upper. %triangular matrix u, and permutation matrix p so that p*a = l*u. Lu composition code example - to use in homework, tests. [l,u,p] = lu(a); y = l\(p*b); x = u\y;

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related textbook solutions

Related Documents