How can I use an index of zero in an array in MATLAB?
20 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 27 Jun. 2009
Bearbeitet: MathWorks Support Team
am 13 Apr. 2023
It would be nice if MATLAB allowed the programmer to decide how they would index into matrices.
Akzeptierte Antwort
MathWorks Support Team
am 10 Apr. 2023
Bearbeitet: MathWorks Support Team
am 13 Apr. 2023
MATLAB does not allow an index of zero into an array unless you are performing logical indexing using a vector including a logical 0 and want to ignore the corresponding element of the array into which you are indexing.
As a workaround, you can create a MATLAB object with which you can use zero-based indexing. A sample object that implements some of the basic MATLAB arithmetic operators is available from the MATLAB Central File Exchange. The example was written by Nabeel Azar and is available in the "varbase.zip" file that can be found at the following URL:
Note that MathWorks does not guarantee or warrant the use or content of these submissions. Any questions, issues, or complaints should be directed to the contributing author.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!