Problem 44258. Outer product of multiple vectors
In tensor algebra, it is often useful to define a tensor as a product of lower order tensors. Similarly, a multidimensional array T might be defined as an outer product of vectors, where a given element is defined by
T(i,j,k) = A(i)*B(j)*C(k);
Create a function outerProduct that accepts any number of row or column vectors and calculates their outer product. For the above example,
T = outerProduct(A,B,C);
Solution Stats
Problem Comments
-
1 Comment
The final test may not be the ideal choice, as the answer, with expected value around 50¹⁰⁰⁰ ~ 10¹⁶⁹⁹, becomes "Inf" almost certainly. Also there are no outputs of dimension>2 required by the Test Suite.
Solution Comments
Show commentsProblem Recent Solvers103
Suggested Problems
-
Return the 3n+1 sequence for n
8400 Solvers
-
Back to basics 21 - Matrix replicating
1744 Solvers
-
Find third Side of a right triangle given hypotenuse and a side. No * - or other functions allowed
245 Solvers
-
Try 1.5.4: Celsius to Fahrenheit
847 Solvers
-
Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock. Tick. Tock.
947 Solvers
More from this Author9
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!