recurDet - You may use itteration % to go across a row, but...

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

View Full Document Right Arrow Icon
Sheet1 Page 1 %========================================================================== % Problem 2. Finding the determinant of a matrix using recursion %-------------------------------------------------------------------------- % % Problem Statement: % % Write a function called recurDet which takes in a square matrix and % returns the determinant of that matrix using recursion. % % Hint: Use the method of expansion by minors.
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: You may use itteration % to go across a row, but you must use recursion to actually find the % determinants. % % % Notes: % -You *must* use recursion to solve this problem. % function ans = recurDet(A) [r c] = size(A) ans = 0 minorsigns = 1 for i=1:r j=1:r j(i)= ans = ans + minorsigns.*A(i,1).*det(A(j,2:r)) minorsigns = -minorsigns end end...
View Full Document

This note was uploaded on 07/06/2009 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.

Ask a homework question - tutors are online