 # Numerical Analysis in Matlab

## Transcribed Text

1. (a) Write a MATLAB function x = bcksbst(U,b) that inputs a nonsingular upper triangular matrix U, and a column vector b of the same dimension and output will be a column vector x, which is the numerical solution of the linear system Ux = b obtained from the back substitution algorithm. (b) Use this function to solve the system Ux = b with 1 2 3 4 4 0 2 3 4 3 U = b = 0 0 3 4 2 0 0 0 4 1 (c) How much cpu time it takes in part (b) ? (d) Use U\b, MATLAB build-in function to solve (b), how much cpu time it takes? 2. By hand, not MATLAB, solve the following system without partial pivoting (no row interchange) - - + 6z2 + 9x3 = 39 3. Use MATLAB to generate a plot of size n of the Hilbert matrix H vs the quantity k = for n = 5.10.15 100. You will use MATLAB function hilb(n) to generate the Hilbert matrix of size n. What do you observe? Use appropriate scale for plot. (Note: k = is called the condition number of the matrix A and MATLAB has a built-in function cond(A, inf) to calculate this).

## Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

function x=bcksbst(U,b)
%Input: U Uppertriangular square matric
%       b vector
%Output: x, solutions of Ux=b

n=size(U,1);

x=zeros(size(b));

x(n)=b(n)/U(n,n);

for i=n-1:-1:1
a=b(i);
for j=n:-1:i+1
a=a-U(i,j)*x(j);
end
x(i)=a/U(i,i);
end

return...
\$30.00 for this solution

PayPal, G Pay, ApplePay, Amazon Pay, and all major credit cards accepted.

### Find A Tutor

Get College Homework Help.

Are you sure you don't want to upload any files?

Fast tutor response requires as much info as possible.