Cody

Solution 2075488

Submitted on 31 Dec 2019 by Nikolaos Nikolaou
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 = magic(3); degrees=180; y_correct = rot90(x,2); assert(isequal( rot(x,degrees),y_correct))

y = [] ans = 2 x = 4 3 8 9 5 1 2 7 6 y = []

2   Pass
x = magic(4); degrees=270; y_correct = rot90(x,3); assert(isequal( rot(x,degrees),y_correct))

y = [] ans = 3

3   Pass
x = magic(5); degrees=360; y_correct = x; assert(isequal( rot(x,degrees),y_correct))

y = [] ans = 0 y = 17 24 1 8 15 23 5 7 14 16 4 6 13 20 22 10 12 19 21 3 11 18 25 2 9

4   Pass
x=[1,4,2,6;3,4,5,6;1,1,1,1;2,2,2,2]; degrees=630; y_correct = rot90(x,7); assert(isequal( rot(x,degrees),y_correct))

y = [] ans = 3

5   Pass
x=[1,4,2,6;3,4,5,6;1,1,1,1;2,2,2,2]; degrees=1170; y_correct = rot90(x,13); assert(isequal( rot(x,degrees),y_correct))

y = [] ans = 1 x = 2 1 3 1 2 1 4 4 2 1 5 2 2 1 6 6 y = [] x = 2 2 2 2 1 1 1 1 6 5 4 3 6 2 4 1 y = []

6   Pass
assert(isempty(regexp(evalc('type rot'),'(eval|flip|transpose|fliplr|flipud|flipdim|rot90|)')))

Suggested Problems

More from this Author111