solve the questions in matlab

solve the questions in matlab


MATLAB Assignment 3 Due Friday April 14, 2023 at 11:59 PM EDT (Maryland time) on Gradescope Instructions: On ELMS, see the file MATLAB basics.pdf to learn how to get MATLAB and do some basic commands first. You may work with up to two other people (groups of three total). If you choose to work together, you may simply submit one copy, and everyone will be receiving the same grade. Make sure to include all names when submitting to Gradescope! Submitting: To get an idea of what you should be submitting, you can first download the file Example Matlab File.m in the Files section. Open it in Matlab. Then at the top of the program, click on the PUBLISH tab. Click on the Publish button, and it should output an html file with all the code/output. This format is what your Matlab assignment should look like. When you are done with the actual Matlab project, click the Publish button, save this as a PDF, and upload this to Gradescope. There is a tab on ELMS that links you to Gradescope. Remember to separate each problem by a section using the double percent signs. Even if you have the correct code, if there is no output, you will NOT receive full credit! (separate problems by using double percent signs as shown in the example file!!!!) 1. Use format rat. Define A =  −4 1 1 20 0 1 −1 3 12 17 −6 −4 −10 −1 −2 3 3 −10 2 5  . (a) Use the rref command and then determine a basis for the column space and the kernel for matrix A. You can use disp or fprintf to show your answer. For simplicity, you may express the vectors using parentheses like it is done in class. (b) Suppose A now is treated as the matrix representation of a linear transformation. Is the transformation one-to-one/injective? Onto/surjective? Use disp or fprintf to clearly justify your answer. 2. Use format rat. Define A = 5 −2 4 0 1 34 1 −1 3 1 0 2 0 1 3 1 0  (a) Find a basis for the row space of A. Use disp or fprintf, and express the vectors as row vectors using brackets e.g. {[3 4 6 1], [1 3 5 7]} 1 (b) Find a basis for the column space of A. Use disp or fprintf. For simplicity, you may express the vectors using parentheses like it is done in class. (c) Does dim(row(A)) = dim(col(A))? Use disp or fprintf to briefly explain. (d) Does the set row(A) = col(A)? Use disp or fprintf to briefly explain. 3. Use format rat. Consider the basis B = {(3,−4, 0, 1, 5), (1, 0, 5,−3, 0), (−3,−3, 6,−3, 1), (5, 4, 3, 2,−2), (4, 6, 3, 1,−5))} in R5. Let v = (1, 1, 1, 1, 1). Make sure to show your computations, and use disp or fprintf to briefly explain what you are doing. A correct numerical answer with no reasoning will not yield full credit. (a) Determine [(0, 0, 0, 0, 0)]B without doing any Matlab commands. Explain how you deduced your answer. (b) Use appropriate Matlab commands to find u where [u]B = v. (c) Use appropriate Matlab commands to find w where w = [v]B. 4. Use format rat. Consider the polynomials (read carefully) f1(x) = x+ x 3 f2(x) = −3 + x+ 3x2 + 4x3 + x4 f3(x) = 3 + x 2 − x3 + x5 f4(x) = −12− x− x2 + 5x3 + x4 − 4x5 f5(x) = x 2 + x5 that lie in P5. Let W = Span({f1(x), f2(x), f3(x), f4(x), f5(x)}). (a) Denote each of the 5 vectors vi = [fi(x)]B to be the coordinate vector of fi(x) relative to the basis B = {1, x, x2, x3, x4, x5} in P5. Define these as column vectors in Matlab as v1, v2,... (b) Use appropriate commands with the matrix above to help find a basis S for W . Use disp or fprintf to explicitly show what the basis is as polynomials. (c) Does the basis found in the previous part span P5? Use disp or fprintf to explain your answer. (d) Does the set entire set {f1(x), f2(x), f3(x), f4(x), f5(x)} span P5? Use disp or fprintf to explain your answer. 5. Use format short. We first show the set of vectors B = {1, cos(x), cos2(x), cos3(x), cos4(x)} 2 is linearly independent over the vector space of real-valued functions. That is, we want to show the equation a0(1) + a1 cos(x) + a2 cos 2(x) + a3 cos 3(x) + a4 cos 4(x) = 0̂ (1) is true only when a0 = a1 = a2 = a3 = a4 = 0 (where 0̂ denotes the zero function that maps everything to 0). Note that (1) must hold for all values of x. If the set of functions was linearly dependent, then for any dependent relation, say 3 − 4 cos(x) + 12 cos2(x)− 2 cos3(x) + 2 cos4(x) = 0̂ (this is not a true equation), we should still observe linear dependency for explicit values of x e.g. if we plugged in x = π/23. (a) By subbing in a value for x in (1), we get a linear equation in terms of variables a0, a1, a2, a3, and a4. Sub in x = 0.1, 0.2, 0.3, 0.4, 0.5 to create a linear system of 5 equations and 5 unknowns. Define its coefficient matrix by A in Matlab. (b) Observe the system has a non-trivial solution if and only if (1) would have a non- trivial solution. Use appropriate Matlab commands to conclude the system only has a trivial solution, thus implying B is a linearly independent set of vectors. (c) Let C = {1, cos(x), cos(2x), cos(3x), cos(4x)}. We have the following identities: cos(2x) = −1 + 2 cos2(x) cos(3x) = −3 cos(x) + 4 cos3(x) cos(4x) = 1− 8 cos2(x) + 8 cos4(x). With the help of the identities, determine the B-coordinate vectors for the 5 vectors in C. Define these as column vectors in Matlab as u1, u2,... (d) Using part (c), define an appropriate matrix B and use Matlab commands to determine if C is a linearly independent set or not. Use disp or fprintf to briefly explain your answer. (e) If D = Span(B), explain why C forms a basis for D. 3
Apr 15, 2023
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here