Question: Please solve using MATLAB 2 Generate square (n x n) matrices with random elements (rand() or randn()) and n of 300, 500, 700, 900, 1100.

Please solve using MATLAB
2 Generate square (n x n) matrices with random elements (rand() or randn()) and n of 300, 500, 700, 900, 1100. Measure how long it takes Matlab to solve a linear system with each matrix and a corresponding random n x 1 right-hand vector by running tic; x = A b; time needed = toc;. Plot time needed versus n on a log- log scale. How does the calculation time change as n gets bigger? Conduct a linear regression of log(time_needed) as a function of log(n) and report the slope of the regression line. What slope would you expect if the calculation time was proportional to the number of arithmetic operations required to perform LU factorization? 2 Generate square (n x n) matrices with random elements (rand() or randn()) and n of 300, 500, 700, 900, 1100. Measure how long it takes Matlab to solve a linear system with each matrix and a corresponding random n x 1 right-hand vector by running tic; x = A b; time needed = toc;. Plot time needed versus n on a log- log scale. How does the calculation time change as n gets bigger? Conduct a linear regression of log(time_needed) as a function of log(n) and report the slope of the regression line. What slope would you expect if the calculation time was proportional to the number of arithmetic operations required to perform LU factorization
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
