Cody

Problem 44967. Hello

Solution 1946885

Submitted on 24 Sep 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   Fail
x = 0; y_correct = 2; assert(isequal(nearestprime(x),y_correct))

Undefined function 'nearestprime' for input arguments of type 'double'. Error in Test1 (line 3) assert(isequal(nearestprime(x),y_correct))

2   Fail
x=eye(7);r=7;c=7; assert(isequal(x,BreakTheMatrix(x,r,c)))

Unrecognized function or variable 'x'. Error in BreakTheMatrix (line 2) y = x; Error in Test2 (line 2) assert(isequal(x,BreakTheMatrix(x,r,c)))

3   Fail
temp=ceil(8*rand)+3; x=ones(temp);r=2;c=2; M=BreakTheMatrix(x,r,c); assert(size(M,3)==(temp-1)^2); assert(all(arrayfun(@(a) isequal(M(:,:,a),ones(2)),1:size(M,3))))

Unrecognized function or variable 'x'. Error in BreakTheMatrix (line 2) y = x; Error in Test3 (line 3) M=BreakTheMatrix(x,r,c);

Suggested Problems

More from this Author2