This question requires you to use MATLAB. Enter exactly the MATLAB commands: clear all A = gallery('toeppen',300); (a) [2 marks] What are the values of the first 3 elements in the second row of A? Enter your answer as a MATLAB vector in the correct order. (b) [1 mark] Is A symmetric? Yes No (c) [3 marks] Create a spy plot of the non-zero elements of the matrix A. i) What is the upper and lower bandwidth of A? Lower = Number Upper = Number ii) What is the sparsity of A as a percentage? Number % (d) [1 mark] Give an estimate of the 1-norm condition number of A. ??(A) = Number (e) [3 marks] A is known exactly and the relative error in b is 1.2 × 10??. i) Define the variable reb to have value 1.2 × 10??. Give any MATLAB command(s) you used. ii) Estimate the relative error in a computed solution x? to Ax = b. Number
Added by Rebecca C.
Close
Step 1
** Show more…
Show all steps
Your feedback will help us improve your experience
Shyam P and 93 other Calculus 3 educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
2. (30 Points) Consider the following two-dimensional function c(x, y) = sin(√((x + 3)² + (y + 2)²)) / √((x + 3)² + (y + 2)²) (a) Using an anonymous function for c(x,y) and MATLAB's mesh function, create a 3D plot of the function from -10 ≤ x ≤ 10, and -10 ≤ y ≤ 10. (b) Using an initial guess of [0 0], find the maximum using MATLAB's built-in function fminsearch. Use the fprintf function to print the results with 10 digits to the right of the decimal point (e.g. "The maximum value of c, x.xxxxxxxxxx, occurs at x = x.xxxxxxxxxx and y = x.xxxxxxxxxx.") (c) Using MATLAB's plot3 and hold commands, plot a red asterisk at the maximum in figure 2. (d) Repeat parts b and c with an initial guess of [7 -5] and a green asterisk. Use fprintf statements to answer the question: What changes and why?
Sri K.
Problem No. 1: In the Command Window of MATLAB®, what would be the answer. (3-Digits, 3 pts each) 1. >> (14/11)/(33*(5*7)) = ______ 3. >> 23/8 - (7/6) = ______ 2. >> 2^(4 + (6/8)) = ______ 4. >> (20 - (22/17)) = ______ Problem 2: Find the MATLAB Errors in the Command Window lines. Circle the mistake in each. Assume all variables have been defined previously in MATLAB. (3 pts each) 1. >> yy = 2*z + 9X9 3. >> 9*g = x*y*5 2. >> Z12 = linspace (119, 333, -1b) 4. >> C11 = 10/b:12:22 Problem 3: Given the following vectors, what is the result: (3 pts each) Answers: a. 1x1 matrix b. 1x5 matrix c. Error d. 1x4 matrix e. 5x4 matrix f. 4x3 matrix 1. xx * yy = ______ x = [1 2 3 4 5] y = [5 6 7 8 9]' 2. x * y * z = ______ z = [0 1 2 3 4] xxx = [1]' 3. y * zz = ______ xx = [3 4 5 6 7]' yy = [1 2 3 4]' 4. yy * zzz = ______ zz = [7 8 9 10] zzz = [2 3 4] Problem 4: Fill in the letter for the correct answer: (3 pts each) a. -3 -4 -5 -6 b. Error c. 1 34 67 d. 1 4 7 e. -2 -1 0 1 f. 0 -4 1. >> G = 1:3:9 ______ 3. >> H = linspace(0, -4, 2) ______ 2. >> M = -3:-1:-6 ______ 4. >> K = linspace(-2, 1, 4) ______
Adi S.
Recommended Textbooks
Calculus: Early Transcendentals
Thomas Calculus
Transcript
Watch the video solution with this free unlock.
EMAIL
PASSWORD