Cody

Solution 803111

Submitted on 8 Jan 2016 by Andriy Nych
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 = 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(mat(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

2   Pass
%% x = 10; y_correct = [1 0 0 0 0 0 0 0 0 0; 0 2 0 0 0 0 0 0 0 0; 0 0 3 0 0 0 0 0 0 0; 0 0 0 4 0 0 0 0 0 0; 0 0 0 0 5 0 0 0 0 0; 0 0 0 0 0 6 0 0 0 0; 0 0 0 0 0 0 7 0 0 0; 0 0 0 0 0 0 0 8 0 0; 0 0 0 0 0 0 0 0 9 0; 0 0 0 0 0 0 0 0 0 10] assert(isequal(mat(x),y_correct))

y_correct = 1 0 0 0 0 0 0 0 0 0 0 2 0 0 0 0 0 0 0 0 0 0 3 0 0 0 0 0 0 0 0 0 0 4 0 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 0 0 0 0 6 0 0 0 0 0 0 0 0 0 0 7 0 0 0 0 0 0 0 0 0 0 8 0 0 0 0 0 0 0 0 0 0 9 0 0 0 0 0 0 0 0 0 0 10

Suggested Problems