Cody

Solution 2076103

Submitted on 1 Jan 2020 by Asif Newaz
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
filetext = fileread('matrixManipulation.m'); assert(isempty(strfind(filetext, 'system')))

2   Pass
x = 1; y_correct = ones(2); assert(isequal(matrixManipulation(x),y_correct))

y = 1

3   Pass
x = 2; y_correct = [1 1/2; 2 1]; assert(isequal(matrixManipulation(x),y_correct))

y = 1 0 0 1

4   Pass
x = 2:4; y_correct = [1 1/2 1/3; 2 1 1/4; 3 4 1]; assert(isequal(matrixManipulation(x),y_correct))

y = 1 0 0 0 1 0 0 0 1

5   Pass
x = 2:7; y_correct = [1 1/2 1/3 1/4; 2 1 1/5 1/6; 3 5 1 1/7; 4 6 7 1]; assert(isequal(matrixManipulation(x),y_correct))

y = 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1

Suggested Problems

More from this Author59