Cody

Solution 1228763

Submitted on 11 Jul 2017 by Peng Liu
  • Size: 26
  • 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
filetext = fileread('outerProduct.m'); assert(~contains(filetext,'regexp'))

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

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

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

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