Question: WTITE A MATLAB SCRIPT FOR THE FOLLOWING: Write a script to solve each of the following parts. In each part, use the command rand(N,M) to

WTITE A MATLAB SCRIPT FOR THE FOLLOWING:

Write a script to solve each of the following parts. In each part, use the command rand(N,M) to create a random matrix with N rows and M columns. Also, use the command disp to print matrices.

(a) Produce a random33matrixAthat is invertible (Hint: use a while-loop until you get one with non-zero determinant). Then create a random31vectorband solve the equation Ax =b for x. Then check your answer by computing Axb and confirming that it is the zero-vector(or close).

(b) Have MATLAB construct a pair of 21vectors of random integers (dont forget to make the numbers integers!) between 1 and 10 until you find a pair that are linearly dependent. Hint: Two vectors are dependent if, after forming a matrix with those vectors as columns, the matrix formed has zero determinant. Once you do, display the pair and how many tries it took to find them.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!