Cody

Problem 44443. Matrix to vector transformation

Solution 2097255

Submitted on 18 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
x = [1 2 3;4 5 6;7 8 9]; y_correct = [1 3 5 7 9 8 6 4 2]' assert(isequal(vectorizeit(x),y_correct))

y_correct = 1 3 5 7 9 8 6 4 2 y = 1 4 7 2 5 8 3 6 9 a = 4 2 8 6 b = 1 7 5 3 9 b1 = 1 3 5 7 9 a1 = 8 6 4 2 out = 1 3 5 7 9 8 6 4 2 out = 1 3 5 7 9 8 6 4 2

2   Pass
x = [5 8 9 ;7 22 9]; y_correct = [5 7 9 22 8]' assert(isequal(vectorizeit(x),y_correct))

y_correct = 5 7 9 22 8 y = 5 7 8 22 9 9 a = 8 22 b = 5 7 9 9 b1 = 5 7 9 9 a1 = 22 8 out = 5 7 9 9 22 8 out = 5 7 9 22 8

3   Pass
x = [88 99; 0 64]; y_correct = [99 88 64 0]' assert(isequal(vectorizeit(x),y_correct))

y_correct = 99 88 64 0 y = 88 0 99 64 a = 88 0 64 b = 99 b1 = 99 a1 = 88 64 0 out = 99 88 64 0 out = 99 88 64 0

4   Pass
x = [0 0; 1 1]; y_correct = [1 0]' assert(isequal(vectorizeit(x),y_correct))

y_correct = 1 0 y = 0 1 0 1 a = 0 0 b = 1 1 b1 = 1 1 a1 = 0 0 out = 1 1 0 0 out = 1 0