Welcome to the Julia community! I can’t help with your particular issue, but it might be worth taking a look at this thread about posting questions here in discourse. In particular, you can get the code formatted, making it a bit easier to read. Compare
function foo()
println(“this looks like normal text”)
end
res = [nlsolve((F,x) -> f!(F, x, aᵢ), initial_x) for aᵢ in a]
K = [r.zero for r in res]
But I’m not sure that’s an improvement over the loop? Loops in Julia are generally as fast as “vectorized” code, so in case you’re coming from Matlab/R or a similar environment where vectorization is the key to fast code you can stop worrying!