Question: MATLAB PROGRAMMING MATRIX QUESTION 1. Write a function in Matlab that takes as input the number n, the size of matrices and vectors; m, the

MATLAB PROGRAMMING MATRIX QUESTION

1. Write a function in Matlab that takes as input the number n, the size of matrices and vectors; m, the number of nonzero elements of a sparse matrix; and the sparse matrix whose nonzeros are given in m-component column vectors r, c, and v: the rk row, ck column entry of the matrix is nonzero with value vk, for k = 1, . . . , m.

Finish the program in the following way:

(a) Have the function output the actual n n matrix A represented. Write out or print out your function.

(b) Have the function accept also the input of x, an n-component vector, and, working directly with the r, c, and v, output the matrix-vector multiplication between the sparse matrix and the vector x, and the number of flops involved. Write out or print out your function.

(c) Assuming the sparse matrix is lower triangular and c is in non-decreasing order, have the function accept also the input of b, an n-component vector, and, working directly with the r, c, and v, output column-oriented forward substitution solving for A1 b, and the number of flops involved. Write out or print out your function

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!