Cody

# Problem 44258. Outer product of multiple vectors

Solution 1418521

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
filetext = fileread('outerProduct.m'); assert(~contains(filetext,'regexp'))

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

Name Size Bytes Class Attributes varargin 1x2 224 cell y = 2

Assertion failed.

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

Name Size Bytes Class Attributes varargin 1x2 240 cell y = 2

Assertion failed.

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))

Name Size Bytes Class Attributes varargin 1x2 1744 cell y = 2

Assertion failed.

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

Name Size Bytes Class Attributes varargin 1x1000 120000 cell y = 1000

Assertion failed.