朱莉娅0.5上Juliabox朱莉娅MethodError:没有方法匹配采取(:: Base.AbstractIOBuffer {阵列{UInt8,1}})
为什么以下函数定义产生以下错误:
Julia MethodError: no method matching take!(::Base.AbstractIOBuffer{Array{UInt8,1}})
function CoinTrials(x,y; numtrials=100000, numcoins=5)
Yes=[]
No=[]
for trial in 1:numtrials
trialresults=[]
for coin in 1:numcoins
result = rand(1,2)
push(vec,trialresults)
end
if len(filter(x->x==1,trialresults)) >=3
Yes+=1
else
No+=1
end
end
@printf(Yes,No)
end
这段代码有很多语法错误,朱莉娅0.5甚至没有接近编译它。什么是vec? printf必须将字符串字面量作为其第一个参数。请更正代码。 – Terminus