Cody

# Problem 42679. Can you reshape the matrix?

Solution 2317783

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 y = 1 2 3 4

Assertion failed.

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

row = 4 y = 1 2 3 4

Assertion failed.

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

row = 2 y = 1 3 2 4

Assertion failed.

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

row = 2

Error using reshape Product of known dimensions, 2, not divisible into total number of elements, 5. Error in your_fcn_name (line 2) y = reshape(A,row,[]) Error in Test5 (line 3) assert(isequal(your_fcn_name(A,row),y_correct));

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!