Generalized Array Operations

version (2.63 KB) by Douglas Schwarz
Computes generalized array operations by expanding singleton dimensions.


Updated 15 Mar 2006

View License

Computes functions of arrays where the singleton dimensions of each have been expanded to be the size of the other, without actually copying any data.

For example,

x = rand(4,3,1,2);
y = rand(4,1,5,2);
z = genop(@times,x,y);

size(z) will be [4 3 5 2].

Cite As

Douglas Schwarz (2022). Generalized Array Operations (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R14SP2
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired: bsxfun substitute

Community Treasure Hunt

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

Start Hunting!