Zero-Based Indexable Arrays (OOP Exercise)

Versión (3,94 KB) por Matt J
Creates arrays whose indexing starts from zero instead of one.
397 descargas
Actualizado 16 oct 2011

Ver licencia

I created this class of zero-indexable arrays purely as a fun OOP exercise, in reaction to various Newsgroup threads inquiring about zero-indexable matrix types for MATLAB. Even though I've gone to the trouble to overload many methods for the class, I offer it as a toy, nothing more, and strongly urge you not to use it for anything serious.



where B is a normal MATLAB matrix will cast B to A, which is exactly
the same, except that it is 0-based indexed instead of 1-based.



A =

0.7922 0.0357 0.6787
0.9595 0.8491 0.7577
0.6557 0.9340 0.7431


ans =



It works for sparse matrices to, and will even display at the command line
with zero-based indexing display syntax, e.g.,

>> A=ZeroBased(speye(3))

A =

(0,0) 1
(1,1) 1
(2,2) 1

Citar como

Matt J (2024). Zero-Based Indexable Arrays (OOP Exercise) (, MATLAB Central File Exchange. Recuperado .

Compatibilidad con la versión de MATLAB
Se creó con R2011a
Compatible con cualquier versión
Compatibilidad con las plataformas
Windows macOS Linux
Más información sobre Creating and Concatenating Matrices en Help Center y MATLAB Answers.

Community Treasure Hunt

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

Start Hunting!
Versión Publicado Notas de la versión