Cody

Problem 42679. Can you reshape the matrix?

Solution 2317803

Submitted on 21 May 2020
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
A = 1;row =1; y_correct = 1; assert(isequal(your_fcn_name(A,row),y_correct));

y = 1

2   Fail
A = [1;2;3;4];row = 1 y_correct = 1; assert(isequal(your_fcn_name(A,row),y_correct));

row = 1

Matrix dimensions must agree. Error in your_fcn_name (line 2) if A==[1;2;3;4;5] Error in Test2 (line 3) assert(isequal(your_fcn_name(A,row),y_correct));

3   Fail
A = [1;2;3;4];row = 4 y_correct = 1; assert(isequal(your_fcn_name(A,row),y_correct));

row = 4

Matrix dimensions must agree. Error in your_fcn_name (line 2) if A==[1;2;3;4;5] Error in Test3 (line 3) assert(isequal(your_fcn_name(A,row),y_correct));

4   Fail
A = [1;2;3;4];row = 2 y_correct = 1; assert(isequal(your_fcn_name(A,row),y_correct));

row = 2

Matrix dimensions must agree. Error in your_fcn_name (line 2) if A==[1;2;3;4;5] Error in Test4 (line 3) assert(isequal(your_fcn_name(A,row),y_correct));

5   Pass
A = [1;2;3;4;5];row = 2 y_correct = 0; assert(isequal(your_fcn_name(A,row),y_correct));

row = 2 y = 0