Cody

Problem 43026. Determinant of a 3x3 Matrix

Solution 994706

Submitted on 5 Oct 2016
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
filetext = fileread('dtrmnt_3x3.m'); assert(isempty(strfind(filetext, 'det')),'det() forbidden')

Error using fileread (line 22) Could not open file dtrmnt_3x3.m. No such file or directory. Error in TestPoint1 (line 1) filetext = fileread('dtrmnt_3x3.m');

2   Fail
x = [3 0 2; 2 1 -2; 0 1 1]; y_correct = 13; assert(sum(sum(abs(dtrmnt_3x3(x)-y_correct)))<1e-3)

Undefined function 'dtrmnt_3x3' for input arguments of type 'double'. Error in TestPoint2 (line 3) assert(sum(sum(abs(dtrmnt_3x3(x)-y_correct)))<1e-3)

3   Fail
x = [1 40 2; 7 -9 10; 1 0 1]; y_correct = 129; assert(sum(sum(abs(dtrmnt_3x3(x)-y_correct)))<1e-3)

Undefined function 'dtrmnt_3x3' for input arguments of type 'double'. Error in TestPoint3 (line 3) assert(sum(sum(abs(dtrmnt_3x3(x)-y_correct)))<1e-3)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!