Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a function in Matlab that takes as input a size n and a tridiagonal matrix given as three vectors: n 1 vector v representing

Write a function in Matlab that takes as input a size n and a tridiagonal matrix given as three vectors: n 1 vector v representing the main diagonal, (n 1) 1 vector w representing the upper diagonal, and (n 1) 1 vector z representing the lower diagonal. Have this function output the LU factorization with the U as two vectors and the L as one vector representing the diagonals. Also output the number of flops used. Use only basic programming.

(a) Write out or print out your function.

(b) Run the case with n = 10, v the vector of 2s, w and z the vector of 1s, and b the vector of 1s. Write down your results for the diagonals of L and U.

(c) Run the case with n = 50 and n = 100 with v the vector of 2s, w and z the vector of 1s. Write down your results for the number of flops used

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

Recommended Textbook for

Pro Database Migration To Azure Data Modernization For The Enterprise

Authors: Kevin Kline, Denis McDowell, Dustin Dorsey, Matt Gordon

1st Edition

1484282299, 978-1484282298

More Books

Students also viewed these Databases questions

Question

3. How has Starbucks changed since its early days?

Answered: 1 week ago