4 ms·
Don't forget matlab starts at 1. R starts at 1. Mathematica starts at 1 by default, though you can override that for any given array. 1-based indexing is very
by RogerL 12y ago
Don't forget matlab starts at 1. R starts at 1. Mathematica starts at 1 by default, though you can override that for any given array.
1-based indexing is very common in mathematical software.
- stan_rogers 12y agoIndeed, zero-based indexing is sort of a ridiculous concession to the hardware (whether that be data/address line labelling by power of two or offsets from a memory location) if bit-twiddling isn't your goal. (Even binary operations don't necessarily imply bit-twiddling at the conceptual level, even if that's what's going on under the hood.) We've just become rather used to counting by calling the first thing zero (and somehow have managed to forget that we had to learn that).
- Ntrails 12y agoHaving started in Matlab I still regularly forget that indexes start at zero in c# and end up with errors. I feel like either option is just catering to user preference at this point, as I don't feel there's a conclusive winner logically.