Assignment title: Information


​​​ Create a function that calculates the determinant and the inverse of a generic 2 × 2 matrix, following the algorithm seen in class (see Lecture 2, from slide 20, here is the lecture video). The function should be named invanddet2by2.m. The function takes a generic 2×2 matrix as input, and returns two outputs: the determinant and the inverse. It should do the following few things: 1 1. It calculates the determinant 2. If the determinant is zero, the inverse is set to be an empty matrix (i.e. you assign the value [], that's squared brackets with no values inside, which for Matlab means an empty matrix) 3. If the determinant is non-zero, then it calculates the inverse according to the 4-steps algorithm seen in class Problem 2 (this is slightly more difficult) Create a function that calculates the determinant and the inverse of a generic 3 × 3 matrix, following the algorithm seen in class (see Lecture 2, from slide 28, here is the lecture video). The function should be named invanddet3by3.m. The function takes a generic 3×3 matrix as input, and returns two outputs: the determinant and the inverse. It should do the following few things: 1. It calculates the adjugate matrix • Hint 1: you need to find a clever way to select columns and rows in order to compute the cofactors, this will probably test your ability to look for help • Hint 2: you may want to use a for loop 2. It calculates the determinant 3. If the determinant is zero, the inverse is set to be an empty matrix (i.e. you assign the value [], that's squared brackets with no values inside, which for Matlab means an empty matrix) 4. If the determinant is non-zero, then it calculates the inverse according to the algorithm seen in class