Cody

# Problem 619. Multiply a column by a row

Solution 2019451

Submitted on 14 Nov 2019 by Kylie Taylor
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
C=[4; 1; 2]; R=[2 3 5]; M=[8 12 20; 2 3 5; 4 6 10]; assert(isequal(mul(C,R),M));

p = 8 U = 8 1 1 1 1 1 1 1 1 p = 12 U = 8 12 1 1 1 1 1 1 1 p = 20 U = 8 12 20 1 1 1 1 1 1 p = 2 U = 8 12 20 2 1 1 1 1 1 p = 3 U = 8 12 20 2 3 1 1 1 1 p = 5 U = 8 12 20 2 3 5 1 1 1 p = 4 U = 8 12 20 2 3 5 4 1 1 p = 6 U = 8 12 20 2 3 5 4 6 1 p = 10 U = 8 12 20 2 3 5 4 6 10 M = 8 12 20 2 3 5 4 6 10

2   Pass
C=[1; 1; 1]; R=[1 1]; M=ones(3,2); assert(isequal(mul(C,R),M));

p = 1 U = 1 1 1 1 1 1 p = 1 U = 1 1 1 1 1 1 p = 1 U = 1 1 1 1 1 1 p = 1 U = 1 1 1 1 1 1 p = 1 U = 1 1 1 1 1 1 p = 1 U = 1 1 1 1 1 1 M = 1 1 1 1 1 1

3   Pass
C=[1;2;3;0]; R=[7,2]; M=[7 2; 14 4; 21 6; 0 0]; assert(isequal(mul(C,R),M));

p = 7 U = 7 1 1 1 1 1 1 1 p = 2 U = 7 2 1 1 1 1 1 1 p = 14 U = 7 2 14 1 1 1 1 1 p = 4 U = 7 2 14 4 1 1 1 1 p = 21 U = 7 2 14 4 21 1 1 1 p = 6 U = 7 2 14 4 21 6 1 1 p = 0 U = 7 2 14 4 21 6 0 1 p = 0 U = 7 2 14 4 21 6 0 0 M = 7 2 14 4 21 6 0 0