Cody

Solution 1997395

Submitted on 31 Oct 2019
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   Pass
filetext = fileread('dtrmnt_3x3.m'); assert(isempty(strfind(filetext, 'det')),'det() forbidden')

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)

dtr1 = 3 dtr2 = 2 dtr3 = 2

Unrecognized function or variable 'c'. Error in dtrmnt_3x3 (line 5) y=x(1)*dtr1 - x(3)*dtr2 + c*dtr3 Error in Test2 (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)

dtr1 = -9 dtr2 = -3 dtr3 = 9

Unrecognized function or variable 'c'. Error in dtrmnt_3x3 (line 5) y=x(1)*dtr1 - x(3)*dtr2 + c*dtr3 Error in Test3 (line 3) assert(sum(sum(abs(dtrmnt_3x3(x)-y_correct)))<1e-3)

Suggested Problems

More from this Author43