{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

sec9 - CS100M Section Exercise 9 1 Determinant of a 3 3...

This preview shows page 1. Sign up to view the full content.

CS100M Section Exercise 9 1 Determinant of a 3 × 3 matrix Write a function myDeterminant(x) , where x is a 3 × 3 matrix. Use the following formula: det a b c d e f g h i = a det e f h i - b det d f g i + c det d e g h You may use the built-in function det to find the determinants of 2 × 2 matrices. For example, det(m) returns the determinant of 2 × 2 matrix m . Recall that you can construct a matrix by puting two row vectors one below the other or two column vectors side by side. 2 Find a value in a matrix Write the following function: function [r, c] = findInMatrix(n,M) % Find all occurrences of the number n in matrix M. % r and c are column vectors of row and column numbers such that % M(r(k),c(k)) is equal to n. % If n is not found in M, r and c are empty vectors. 3 Structure array Write the following function for creating a structure for square data: function Sqr= MakeSquare(x, y, L) % Sqr is a square with % Sqr.x (x-coordinate of lower left corner) assigned x % Sqr.y (y-coordinate of lower left corner) assigned y
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern