小编ute*_*o10的帖子

是否可以在 Julia 中将 Array{Num,1} 转换为 Array{Float64,1} ?

我有以下在 Julia 中使用符号的函数。一切工作正常,直到绘图那一刻

using Distributions
using Plots
using Symbolics
using SymbolicUtils

function BinomialMeasure(iter::Int64, p::Float64, current_level = nothing)

@variables m0 m1

if current_level == nothing
    current_level = [1]
end
next_level = []
for item in current_level
    append!(next_level, m0*item)
    append!(next_level, m1*item)
end

If iter != 0
    current_level = next_level
    return BinomialMeasure(iter - 1, p , current_level)
else
    return [substitute(i, Dict([m0 => p, m1 => 1 - p])) for i in next_level]
end
end

y = BinomialMeasure(10, 0.4)
x = [( i + …
Run Code Online (Sandbox Code Playgroud)

typed-arrays julia ijulia-notebook

3
推荐指数
1
解决办法
438
查看次数

标签 统计

ijulia-notebook ×1

julia ×1

typed-arrays ×1