Cody

Solution 1068362

Submitted on 1 Dec 2016 by paolo77
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

This solution is outdated. To rescore this solution, sign in.

Test Suite

Test Status Code Input and Output
1   Pass
x = 1; y_correct = 1; assert(isequal(special_eye(x),y_correct))

y = 1

2   Pass
x = 3; y_correct = [1 0 0;0 2 0;0 0 3] assert(isequal(special_eye(x),y_correct))

y_correct = 1 0 0 0 2 0 0 0 3 y = 1 0 0 0 2 0 0 0 3

3   Pass
x = 5; y_correct = [1 0 0 0 0;0 2 0 0 0;0 0 3 0 0; 0 0 0 4 0; 0 0 0 0 5] assert(isequal(special_eye(x),y_correct))

y_correct = 1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 5 y = 1 0 0 0 0 0 2 0 0 0 0 0 3 0 0 0 0 0 4 0 0 0 0 0 5