Cody

# Problem 44258. Outer product of multiple vectors

Solution 1418520

Submitted on 17 Jan 2018
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

2   Fail
y = outerProduct([],[]); assert(isempty(y))

Error using outerProduct Too many input arguments. Error in Test2 (line 1) y = outerProduct([],[]);

3   Fail
x = randi(100); y = randi(100); assert(isequal(outerProduct(x,y),x*y))

Error using outerProduct Too many input arguments. Error in Test3 (line 3) assert(isequal(outerProduct(x,y),x*y))

4   Fail
x = randi(100,[1 100]); y = randi(100,[1 90]); assert(isequal(outerProduct(x,y),x.'*y)) assert(isequal(outerProduct(x.',y),x.'*y)) assert(isequal(outerProduct(x,y.'),x.'*y))

Error using outerProduct Too many input arguments. Error in Test4 (line 3) assert(isequal(outerProduct(x,y),x.'*y))

5   Fail
x = randi(100,[1 1000]); xc = num2cell(x); assert(isequal(outerProduct(xc{:}),prod(x)))

Error using outerProduct Too many input arguments. Error in Test5 (line 3) assert(isequal(outerProduct(xc{:}),prod(x)))