Cody

Solution 800602

Submitted on 4 Jan 2016 by Guillaume
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 = [ones(1,10) 2*ones(1,10)]; y_correct = [ones(1,10) zeros(1,10);zeros(1,10) ones(1,10)]; assert(isequal(sprs2matrix(x),y_correct));

2   Pass
%% x = 1:100; y_correct = eye(100); assert(isequal(sprs2matrix(x),y_correct));

3   Pass
%% x = [1 4 5 3 6]; y_correct = [1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 1]; assert(isequal(sprs2matrix(x),y_correct));

4   Pass
%% x = 10; y_correct = zeros(x,1); y_correct (x)=1; assert(isequal(sprs2matrix(x),y_correct));