Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

need help with matlab coding, thanks Submit a one-page PDF report and Matlab scripts (as m-files) you will determine how the computing time varies with

image text in transcribedimage text in transcribedimage text in transcribed

need help with matlab coding, thanks

Submit a one-page PDF report and Matlab scripts (as m-files) you will determine how the computing time varies with matrix size for large random matrices when using Matlab's LU factorization algorithm. Part A: Complete the following, using Matlab's rand (i) command to generate random nn matrices. - For each n that you are considering, generate a number of large random matrices and measure the average computing time that Matlab's LU factorization algorithm requires to factor each matrix into L and U. Be sure to specify how many factorizations you are averaging over. In the computing time estimate, do not include the cost of constructing the random matrices. - Plot the average computing time vs n for a variety of n to visualize the relationship between n and computing time. Choose appropriate scales for the axes in your plot. - Analyze the plot to determine how the time for computing LU varies with n for large n. Use big-Oh notation to describe the relationship and explain your findings. Part B: In this question, you are asked to repeat the process in Part A but this time using a random tridiagonal matrix: Complete the following, using Matlab's spdiags (rand (n,3),1:1,n,n) command to generate random tridiagonal nn matrices. - For each n you are considering, generate a number of large random tridiagonal matrices and measure the average computing time Matlab's LU factorization algorithm requires to factor each tridiagonal matrix into L and U. Be sure to specify how many factorizations you are averaging over. In the computing time estimate, do not include the cost of constructing the random matrices. - Plot the average computing time vs n for a variety of n to visualize the relationship between n and computing time. Choose appropriate scales for the axes in your plot. - Analyze the plot to determine how the time for computing LU varies with n for large n. Use big-Oh notation to describe the relationship and explain your findings. Notes: - In Matlab, a matrix can be factored into LU by the LU factorization command [L,U,P]=1u(A) - The time that a code requires to execute can be measured using the Matlab commands tic and toc. - A random nn tridiagonal matrix can be constructed in Matlab via A-spdiags ( rand(n,3),1:1,n,n); - In Part B, use a sparse matrix representation for the matrix to ensure that Matlab understands the zero structure of the matrix. The spdiags (rand (n,3),1:1, n,n) command should automatically take care of this for you. Your report cannot exceed one page. It should include at least two figures with proper labels. Make sure to choose axis scales appropriate for the data. Discussions should be kept brief and answer all questions asked. Grades will be based on 5 criteria: Figures/Quality of presentation: 2 marks: Well-presented 1 mark: Missing labels, figure is small, inappropriate axis scaling 0 marks: Figures do not present much useful information Writing / Clarity and conciseness: 2 marks: Writing is clear and concise 1 mark: Contains minor spelling or grammatical errors, too brief or too long, does not convey the main ideas 0 marks: Writing quality is poor and cannot be understood easily or at all Data: 2 marks: Data is correct and relevant to the report 1 mark: some data is missing, unimportant data is included 0 marks: No data, data is incorrect, data is irrelevant Part A: 2 marks: Complete and correct analysis and discussion 1 mark: Value is given but discussion contains small errors or is incomplete 0 marks: Analysis and discussion missing, incomplete, and/or incorrect Part B: 2 marks: Complete and correct analysis and discussion 1 mark: Value is given but discussion contains small errors or is incomplete 0 marks: Analysis and discussion missing, incomplete, and/or incorrect

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

Visual C# And Databases

Authors: Philip Conrod, Lou Tylee

16th Edition

1951077083, 978-1951077082

More Books

Students also viewed these Databases questions