I think you have to make your own type. You can't just request that ordinary arrays use different indexing.
On Mon, 2016-10-24 at 20:34, Angel de Vicente <angel.vicente.garr...@gmail.com> wrote: > Hi, > > Isaiah Norton <isaiah.nor...@gmail.com> writes: >> mg = zeros(Int,(0:4,0:4)) >> >> This isn't related to indexing -- it doesn't work with `1:4` >> either. > > But it doesn't complain if I do: > ,---- > | julia> mg=zeros(Int,(0:4)) > | 5-element Array{Int64,1}: > | 0 > | 0 > | 0 > | 0 > | 0 > `---- > > (though then I cannot access mg[0], the indices would go as for a > standard Julia array, 1 to 5. > > >> Use: >> zeros(Int, 4, 4) > > Probably I'm missing something very basic, but then I would just have a > normal array, where the indices would go from 1:4, in each dimension. > > In the page on "Arrays with custom indices" I don't see any clear > example, so I'm a bit lost as to how I could create an array wih > non-standard inidces and how to use it. Any basic example would be > greatly appreciated. > > Thanks and sorry if I'm asking very basic questions, I just had a week > or so of exposure to Julia...