Generalized outer product

Outer product of two cell arrays with custom operator function.
418 download
Aggiornato 16 nov 2010

Visualizza la licenza

[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

Cita come

icklePhil (2025). Generalized outer product (https://it.mathworks.com/matlabcentral/fileexchange/29428-generalized-outer-product), MATLAB Central File Exchange. Recuperato .

Compatibilità della release di MATLAB
Creato con R2009b
Compatibile con qualsiasi release
Compatibilità della piattaforma
Windows macOS Linux
Categorie
Scopri di più su Cell Arrays in Help Center e MATLAB Answers

Community Treasure Hunt

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

Start Hunting!
Versione Pubblicato Note della release
1.0.0.0