Problem 54035. Matrix Rotation
Solution Stats
Problem Comments

8 Comments
There are several errors in the "correct" values for the tests. For example, text #13 has a capital P replaced with a lower case p. Test 11 seems to have an iincorrect value for n. There are also errors in tests 5, 6 and 8.
I'm getting different answers for tests 5, 6, 8, 11, and 13.
In test 6 the center point should not change; in test 8 the center 3 by 3 should not change; test 11 would be ok if n=2,6,10,....
I agree with Tim's comments on tests 6 and 8. I would sum things up by saying that the correct results for tests 6, 8, 11 and 12 are:
Problem 6:
y = [2 1 2 1 2; 1 2 1 2 1; 2 1 1 1 2; 1 2 1 2 1; 2 1 2 1 2];
Problem 8:
y = [0 0 0 0 1; 0 1 0 0 0; 0 0 1 0 0; 0 0 0 1 0; 1 0 0 0 0];
Problem 11:
y = [2 1 2 1 2 1 2; 1 4 5 4 3 4 1; 2 3 2 1 2 5 2; 1 4 1 1 1 4 1; 2 5 2 1 2 3 2; 1 4 3 4 5 4 1; 2 1 2 1 2 1 2];
Problem 12:
y = [13 14 15 16; 9 10 11 12; 5 6 7 8; 1 2 3 4];
I hate to say it, but tests 8 and 12 still seem to be incorrect.
Yes, I agree. Those two are still comparing to matrices that are different than the correct results that I included in my previous comment.
William and Tim, apologies for the fiasco. The test suite has been corrected completely.
Tim, your answer has been rescored and accepted. Do rate the question!
It works! Thanks Dyuman.
Solution Comments
Show commentsProblem Recent Solvers14
Suggested Problems

Remove any row in which a NaN appears
8571 Solvers

933 Solvers

391 Solvers

89 Solvers

358 Solvers
More from this Author31
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!