Cody

Solution 1935139

Submitted on 13 Sep 2019 by Sam McPheeters
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