You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
[O,O_MAT] = OUTER(FUN,VEC1,VEC2)
Generalized outer product, like calculating VEC1 * VEC2' but instead of using multiplication to combine the elements of VEC1 and VEC2, the function provided by function pointer fun is called for each pair of elements and the results are stored in the N-by-M cell matrix O. N is the length of VEC1 and M is the length of VEC2.
The function works primarily on cell arrays VEC1 and VEC2, but inputs in the form of numeric vectors/matrices are accepted too. When using numeric inputs, the function assumes the first dimension of VEC1 and VEC2 to contain the elements to combine.
FUN: operator function pointer, the function must be a binary function operating on inputs of the type contained in the cells of VEC1 and VEC2, its output type is arbitrary
VEC1: first cell array or numeric array/matrix
VEC2: second cell array or numeric array/matrix
O: resulting 2D cell array ('cell matrix')
O_MAT: cell2mat(O), NaN if impossible to cast
Cite As
icklePhil (2026). Generalized outer product (https://se.mathworks.com/matlabcentral/fileexchange/29428-generalized-outer-product), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.0.0.0 (1.9 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
| Version | Published | Release Notes | Action |
|---|---|---|---|
| 1.0.0.0 |
