小编ell*_*inc的帖子

在 for 循环中使用增量

我正在尝试使用边界在 Julia 中运行 for 循环,其中fIr是相同长度的数组。我知道这是不正确的,但这是我想要做的要点。

    a = zeros(1:length(fI))
    for i = 1:length(fI)
      a[i] = (fI[i+1] - fI[i])/(r[i+1] - r[i])
    end
Run Code Online (Sandbox Code Playgroud)

如何在 Julia 中设置 n+1 的增量?没有运气在其他地方找到答案。

如果我能澄清任何事情,请告诉我。我对这门语言还是很陌生。

julia

5
推荐指数
2
解决办法
2151
查看次数

无法在Julia中打开文件

刚刚从GitHub提取了一个存储库,并保存在“下载”下。尝试运行程序并不断出现这些错误:

    julia> using FITSIO

    julia> include("readoifits.jl")
    ERROR: could not open file /home/ellie/Downloads/readoifits.jl
    in include_from_node1(::String) at ./loading.jl:488

    julia> include("setupft.jl")
    ERROR: could not open file /home/ellie/Downloads/setupft.jl
    in include_from_node1(::String) at ./loading.jl:488

    julia> include("oichi2.jl")
    ERROR: could not open file /home/ellie/Downloads/oichi2.jl
    in include_from_node1(::String) at ./loading.jl:488

    julia> include("oiplot.jl")
    ERROR: could not open file /home/ellie/Downloads/oiplot.jl
    in include_from_node1(::String) at ./loading.jl:488
Run Code Online (Sandbox Code Playgroud)

因此,它知道文件存在以及它的位置,但无法打开它们。有人可以解释一下node1和String位的含义以及如何打开这些文件吗?谢谢。

linux github julia

2
推荐指数
1
解决办法
1525
查看次数

标签 统计

julia ×2

github ×1

linux ×1