According to Julia documentation, I should be able to call a given (even non-vectorized) function for every element in an array using fun.(A), where A is an array. I try with a simple example and it doesn't seem to work:
julia> x = collect(linspace(0,pi,100));
julia> y = sin.(x)
ERROR: TypeError: getfield: expected Symbol, got Array{Float64,1}
The same error persists with all my own functions. How do I use this feature correctly?
Just to give this an official answer, this is a new feature that was introduced in Julia 0.5, while @Echows was using Julia 0.4. The solution is to upgrade to Julia 0.5 or newer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With