Question: Answer the following questions about this program: (a) What mathematical problem is solved by this program? (b) What numerical method is used to solve the

Answer the following questions about this program:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 function problem2_78 clc A = [2 1 3; 4 2 1; 1 1 1]; n = 3; q = 1; for

17 18 19 20 21 22 23 24 25 26 27 28 29 A (K, :) = A (swap_row, :); A (swap_row, :) = old pivot; S = -1; else

(a) What mathematical problem is solved by this program?

(b) What numerical method is used to solve the problem?

(c) What does the variable n represent?

(d) What does the variable q represent?

(e) What does the variable s represent?

(f) What mathematical operation is implemented by the for loop in lines 24–29?

(g) What is the output of line 32? You must provide the numerical value.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 function problem2_78 clc A = [2 1 3; 4 2 1; 1 1 1]; n = 3; q = 1; for k=1:n-1 Amax= A (k, k); swap_row = k; for i = k+1:n if abs (A (i, k))> abs (Amax) Amax= A(1,k); swap_row = 1; end end if swap_row ~= k old pivot (1, :) = A (K, :);

Step by Step Solution

3.54 Rating (157 Votes )

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 Numerical Methods With Chemical Engineering Applications Questions!