CSCI 2033: Elementary Computational Linear Algebra (Spring 2020) Assignment 1 (100 points) Due date: February 21st, 2019 11:59pm In this assignment, you will implement Matlab functions to perform row operations, compute the RREF of a matrix, and use it to solve a real-world problem that involves linear algebra, namely GPS localization. For each function that you are asked to implement, you will need to complete the corresponding .m file with the same name that is already provided to you in the zip file. In the end, you will zip up all your complete .m files and upload the zip file to the assignment submission page on Gradescope. In this and future assignments, you may not use any of Matlab’s built-in linear algebra functionality like rref, inv, or the linear solve function A\b, except where explicitly permitted. However, you may use the high-level array manipulation syntax like A(i,:) and [A,B]. See “Accessing Multiple Elements” and “Concatenating Matrices” in the Matlab documentation for more informa- tion. However, you are allowed to call a function you have implemented in this assignment to use in the implementation of other functions for this assignment. Note on plagiarism A submission with any indication of plagiarism will be directly reported to University. Copying others’ solutions or letting another person copy your solutions will be penalized equally. Protect your code! 1 Submission Guidelines You will submit a zip file that contains the following .m files to Gradescope. Your filename must be in this format: Firstname Lastname ID hw1 sol.zip (please replace the name and ID accordingly). Failing to do so may result in points lost. • interchange.m • scaling.m • replacement.m • my_rref.m • gps2d.m • gps3d.m • solve.m 1 Ricardo Ricardo Ricardo Ricardo � The code should be stand-alone. No credit will be given if the function does not comply with the expected input and output. Late submission policy: 25% o↵ up to 24 hours late; 50% o↵ up to 48 hours late; No point for more than 48 hours late. 2 Elementary row operations (30 points) As this may be your first experience with serious programming in Matlab, we will ease into it by first writing some simple functions that perform the elementary row operations on a matrix: interchange, scaling, and replacement. In this exercise, complete the following files: function B = interchange(A, i, j) Input: a rectangular matrix A and two integers i and j. Output: the matrix resulting from swapping rows i and j, i.e. performing the row operation Ri $ Rj . function B = scaling(A, i, s) Input: a rectangular matrix A, an integer i, and a scalar s. Output: the matrix resulting from multiplying all entries in row i by s, i.e. per- forming the row operation Ri sRi. function B = replacement(A, i, j, s) Input: a rectangular matrix A, two integers i and j, and a scalar s. Output: the matrix resulting from adding s times row j to row i, i.e. performing the row operatio.