Question: The following code has four mistakes in it. Correct them. = function [ detM Calculate Determinant ( M ) %in: M is a square matrix
The following code has four mistakes in it. Correct them.

= function [ detM Calculate Determinant ( M ) %in: M is a square matrix out: The determinant of M. i = 1; dimM size (M); if (dimM 1) detM M(1, 1); else detM = 0; for k = 1:dimM (2) detM = (-1)^(i+k) * M(i, k) CalculateDeterminant (MatrixMinor (M, i, k)); end end end * function [ MMinor ] MatrixMinor ( M, i, k) MMinor M([1:i (i+1):end], [1:k (k+1):end]); end
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
