Cody

Problem 44967. Hello

Solution 2872220

Submitted on 23 Aug 2020 by Alfonso Nieto-Castanon
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
x = 0; y_correct = 2; assert(isequal(nearestprime(x),y_correct))

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In BreakTheMatrix (line 1) In ScoringEngineTestPoint2 (line 2) In solutionTest (line 5)]

3   Pass
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))))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In BreakTheMatrix (line 1) In ScoringEngineTestPoint3 (line 3) In solutionTest (line 7)]

Suggested Problems

More from this Author2

Community Treasure Hunt

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

Start Hunting!