Dear all,

I need to creeate a null three-dimensional matrix d = d[s,l,t] where s = [2,3,4,5], l=[12,13,14,15,16] and t=1:12, e.g, I don’t need for example of positions [1,1,1], [1,2,1], etc, but only in the ranges of the given vectors.

Anyone can help me please?

You can have that with: GitHub - JuliaArrays/OffsetArrays.jl: Fortran-like arrays with arbitrary, zero or negative starting indices.

(but maybe if you explain better what you want there may be a better solution)

1 Like

I want a three dimensional matriz where the index of the first dimension is given by: s = [2,4,5,6], the second dimension is only l = 12:16 and the third dimension is the indexes t = 1:12.

Then, I want to build the array d = d[s,l,t]