Question: 4. (30 points) Write a Matlab function that takes as input o n: the dimension of a square matrix m: the number of vectors generates
4. (30 points) Write a Matlab function that takes as input o n: the dimension of a square matrix m: the number of vectors generates an nxn random matrix A and m-many random vectors bi,...bm .generates the LU decomposition of A solves Arb, inear system forali both by using the built-in method and the LU-method and outputs tl: the time it took your computer to solve the systems using the built in method t2: the time it took your computer to solve the systems using LU method. Hints: Use tic and toc command to time your code (google tic toc matlab for its usage) Generate an nxm random matrix and use the columns of that as the vectors b (google how to pull columns from a matrix matlab) 4. (30 points) Write a Matlab function that takes as input o n: the dimension of a square matrix m: the number of vectors generates an nxn random matrix A and m-many random vectors bi,...bm .generates the LU decomposition of A solves Arb, inear system forali both by using the built-in method and the LU-method and outputs tl: the time it took your computer to solve the systems using the built in method t2: the time it took your computer to solve the systems using LU method. Hints: Use tic and toc command to time your code (google tic toc matlab for its usage) Generate an nxm random matrix and use the columns of that as the vectors b (google how to pull columns from a matrix matlab)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
