English 中文(简体)
刚开始和结束的les
原标题:CartesianIndices from start and end tuples
  • 时间:2023-07-03 02:49:03
  •  标签:
  • julia

我愿利用开端和终点站建造<条码>。 例如,我想建造<代码>Cartesian Indices((2,4,3:5),start = (2,3)end =(4,5)

<代码>CartesianIndices没有为此提供构造。 是否有容易的选择?

问题回答

是的:

julia> CartesianIndices(UnitRange.((2,3), (4,5))) |> collect
3×3 Matrix{CartesianIndex{2}}:
 CartesianIndex(2, 3)  CartesianIndex(2, 4)  CartesianIndex(2, 5)
 CartesianIndex(3, 3)  CartesianIndex(3, 4)  CartesianIndex(3, 5)
 CartesianIndex(4, 3)  CartesianIndex(4, 4)  CartesianIndex(4, 5)





相关问题
刚开始和结束的les

我想利用开端和终点拖车来构筑CartesianIndices。 例如,我想在开端=(2,3)和端=(4,5)的情况下建造Cartesian Indices((2,4,3:5)。

Julia symbolic differentiation

Though I ve looked through several pages documenting various differentiation tools in Julia, I have yet to find the following simple functionality. I want to define a function which is differentiable ...

Julia: Return Minimum Date in DataFrame

The question is fairly simple. How do I return the minimum purchase date for each customer using Tidier? using Tidier, DataFrames, Plots, CSV #params f = "path" df = CSV.File(f) |> ...

Reading hex string file in Julia

In python, I do import numpy as np data = np.memmap( mydata.bin , dtype= <i4 , mode= r ) How can I implement this in Julia? I was reading about readbytes and htol but couldn t figure out.

热门标签