Cody

# Problem 44300. Matrix Generation from Vector Multiplication

Solution 1692572

Submitted on 14 Dec 2018 by HH
• Size: 9
• This is the leading solution.
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]; y = [1 2]; out_matrix = [1 2; 2 4]; assert(isequal(your_fcn_name(x,y),out_matrix))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint1 (line 4) In solutionTest (line 3)]

2   Pass
x = (1:3)'; y = 1:3; out_matrix = [1,2,3;2,4,6;3,6,9]; assert(isequal(your_fcn_name(x,y),out_matrix))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint2 (line 4) In solutionTest (line 5)]

3   Pass
x = ones(10,1); y = ones(1,10); out_matrix = ones(10); assert(isequal(your_fcn_name(x,y),out_matrix))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint3 (line 4) In solutionTest (line 7)]

4   Pass
x = ones(1,10); y = ones(10,1); out_matrix = 10; assert(isequal(your_fcn_name(x,y),out_matrix))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint4 (line 4) In solutionTest (line 9)]

5   Pass
x = ones(3,1); y = [7 6 8]; out_matrix = repmat(y,[3,1]); assert(isequal(your_fcn_name(x,y),out_matrix))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint5 (line 4) In solutionTest (line 11)]

6   Pass
x = [1;0;1;0;1]; y = [0,1,0,1,0]; out_matrix = [0,1,0,1,0;0,0,0,0,0;0,1,0,1,0;0,0,0,0,0;0,1,0,1,0]; assert(isequal(your_fcn_name(x,y),out_matrix))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In your_fcn_name (line 2) In ScoringEngineTestPoint6 (line 4) In solutionTest (line 13)]