Hi,
I’m creating cartesianindexes for an 8 dimensional matrix using something like
mypoint = indexin(1.0f0,mybigmatrix)
This works fine and gives me something like …
‘’‘0-dimensional Array{Union{Nothing, CartesianIndex{8}}, 0}:
CartesianIndex(1, 1, 1, 1, 1, 1, 1, 1)’‘’
However, now I would like to create a new CartesianIndex by incrementing a dimension i , so I can add it to a vector of CartesianIndexes.
something like
newpoint = myincrementingfunction (mypoint[1],i) #i is the dimension of the index I wish to increment
and I expect the function to return CartesianIndex(1, 1, 2, 1, 1, 1, 1, 1) for i=3
It seems CartesianIndexes are imutable and I can’t see a way of converting them to a vector, so I can change the index and that’s not a lot of point because I don’t know how to convert a Vector back to a CartesianIndex anyway and converting to a Tuple doesn’t lead to a solution either,
Can anyone suggest the best way to achieve this please.
Thanks
Steve