Problem 44258. Outer product of multiple vectors

Solution 3032575

Submitted on 2 Oct 2020 by Augusto Mazzei
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)))

Suggested Problems

More from this Author9

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!