Cody

Solution 1710089

Submitted on 19 Jan 2019
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   Fail
a = [3 2 4]; y_correct = [1 1 1;2 2 2;3 0 3;0 0 4]; assert(isequal(matInc(a),y_correct))

t1 = 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Unable to perform assignment because the size of the left side is 4-by-3 and the size of the right side is 1-by-3. Error in matInc (line 5) t1(:,1:a(i))=1:a(i) Error in Test1 (line 3) assert(isequal(matInc(a),y_correct))

2   Fail
a = [0 1 1 2 0 3]; y_correct = [0 1 1 1 0 1;0 0 0 2 0 2;0 0 0 0 0 3]; assert(isequal(matInc(a),y_correct))

t1 = 0 0 0 0 0 0 0 0 0 t1 = 0 0 0 0 0 0 0 0 0 t1 = 1 0 0 1 0 0 1 0 0 t1 = 1 0 0 1 0 0 1 0 0

Unable to perform assignment because the size of the left side is 3-by-2 and the size of the right side is 1-by-2. Error in matInc (line 5) t1(:,1:a(i))=1:a(i) Error in Test2 (line 3) assert(isequal(matInc(a),y_correct))