You are now following this Submission
- You will see updates in your followed content feed
- You may receive emails, depending on your communication preferences
When working with multi-dimensional arrays it is sometimes more convenient to perform operations by explicitly specifying the indices. iArray is a class that provides an interface for multiplying,adding,summing over,etc. for multi-dimensional numerical arrays.
Using iArray it is straightforward to implement such mathematical expressions (see the snapshot image for example)
example:
A = iArray( rand(10000,20) , {'i' , 'k'} ) ;
creates a 10000x20 array with indices called 'i' and 'k' . the indices can be renamed at any time using curly braces , e.g. A = A{'i','m'}
B = iArray( rand(10000,20) , {'i' , 'm'} ) ;
w = iArray( rand(10000,1) , {'i'} ) ;
C = sum( w.*A.*B , 'i' );
or equivalently
C = sum( w{'i'}.*A{'i','k'}.*B{'i','m'} , 'i' ) ;
evaluates the expression in the screenshot.
the result C is an 20x20 iArray with indices 'k' and 'm'.
Cite As
Ofer S (2026). Array with named indices (https://www.mathworks.com/matlabcentral/fileexchange/58373-array-with-named-indices), MATLAB Central File Exchange. Retrieved .
General Information
- Version 1.2.0.0 (2.66 KB)
MATLAB Release Compatibility
- Compatible with any release
Platform Compatibility
- Windows
- macOS
- Linux
