Cody

# Problem 1835. Matrix to column conversion

Solution 2106899

Submitted on 27 Jan 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   Fail
x = [10 20 30;40 50 60]; y_correct = [10; 40;20; 50; 30; 60;] assert(isequal(Mat2Vector(x),y_correct))

y_correct = 10 40 20 50 30 60

Unrecognized function or variable 'F'. Error in Mat2Vector (line 2) y = reshape(F,3,2); Error in Test1 (line 3) assert(isequal(Mat2Vector(x),y_correct))

2   Fail
x=[-2 -4 -6; -1 -3 -5; -10 -20 0] y_correct = [-2; -1;-10; -4; -3;-20; -6;-5;0] assert(isequal(Mat2Vector(x),y_correct))

x = -2 -4 -6 -1 -3 -5 -10 -20 0 y_correct = -2 -1 -10 -4 -3 -20 -6 -5 0

Unrecognized function or variable 'F'. Error in Mat2Vector (line 2) y = reshape(F,3,2); Error in Test2 (line 3) assert(isequal(Mat2Vector(x),y_correct))

3   Fail
x=[1 2 3 4 5; 6 7 8 9 10]; x(:,:,2) = [10 20 30 40 50;60 70 80 90 100]; y_correct = [1;6;2;7;3;8;4;9;5;10;10;60;20;70;30;80;40;90;50;100] assert(isequal(Mat2Vector(x),y_correct))

y_correct = 1 6 2 7 3 8 4 9 5 10 10 60 20 70 30 80 40 90 50 100

Unrecognized function or variable 'F'. Error in Mat2Vector (line 2) y = reshape(F,3,2); Error in Test3 (line 4) assert(isequal(Mat2Vector(x),y_correct))