N-dimensional sparse arrays

Creates an N-dimensional sparse array object, for arbitrary N.

Download
Download

You are now following this Submission

Cite As

Matt J (2026). N-dimensional sparse arrays (https://uk.mathworks.com/matlabcentral/fileexchange/29832-n-dimensional-sparse-arrays), MATLAB Central File Exchange. Retrieved .

Categories

Find more on Sparse Matrices in Help Center and MATLAB Answers

General Information

MATLAB Release Compatibility

  • Compatible with R2008a and later releases

Platform Compatibility

  • Windows
  • macOS
  • Linux
Version Published Release Notes Action
1.20.1

Fixed a bug (reported by users) introduced by a change in ind2sub() conventions in R2024b.

Download
1.20.0

Added support for implicit expansion, e.g., one can now do things like
>> ndSparse([1,2,3]) + ndSparse([1;2;3])

Download
1.19.0

updated release compatibility info

Download
1.19.0-0

Indexing bug fix. Affected scalar, linear indexing (see update notes).

Download
1.18.0

Indexing bug fixes.

Download
1.16.0

Improvements to MIN/MAX when dealing with singleton dimensions.

Improved memory efficiency in CAT and null assignment.

Download
1.15.0

Fixed bug involving ndSparse arrays with singleton dimensions. It affected MIN, MAX, SUBSASGN, and CAT.

Download
1.14.0

Speed up indexing operations of the form A(:,:,...,:,i)

Download
1.13.0

Fixed the output of ndSparse.build and CONVN, which sometimes had very large nzmax.

Download
1.12.0

Improved the DISPLAY method, so that now only A(:,:,i,j,k,...) with non-zero data will be displayed.

Download
1.8.0

*Forgot to add installation instructions in my submission earlier this week
*Also, replaced ISDOUBLE in ndsparse.accumarray with something more universal.

Download
1.7.0

*Some bug fixes, including Ohad's issue of assigning a matrix into an array.

*Improved memory efficiency of various operations, but with trade-offs. See UpdateNotes

Download
1.6.0

Fixed a bug in SUBSASGN operations that expand the size of the matrix,
e.g., A(end+1,end+1)=5;
Thanks to Zvi Devir for reporting.

Download
1.5.0

Pervasive changes, some new methods, and some bug fixes. See UpdateNotes in .zip for full details.

Among other things, ndSparse objects should typically consume a lot less memory now.

Download
1.4.0

Fixed a bug in the constructor, which could cause ndSparse object to have incorrect dimensions.

Download
1.3.0

See UpdateNotes in the .zip for full details. Highlights:

1. Lots of new methods!! BSXFUN, REPMAT, CIRCSHIFT,CONVN,...
2. Improved the efficiency of PERMUTE
3. Some small backward-compatibility issues.
4. Added an R2009b compatible version.

Download
1.2.0

See UpdateNotes in the .zip for full details. Highlights:

1. Lots of new methods!! For example BSXFUN, REPMAT, CIRCSHIFT,CONVN.

2. Improved the efficiency of PERMUTE

3. Some small backward-compatibility issues.

Download
1.1.0

*Some improvements to CAT and SUM, including minor bug fixes.
*Added methods MIN, MAX, ANY, ALL for the class.
*Improved error checking.

Download
1.0.0

Download