Greetings everyone. I am a new and young programmer coming from matlab and I am trying to understand the basics of Julia. I have come across the following problem.
I used a function to make a loop and I would like to make a simple plot of x and z in which z is updated in each loop. Whenever I run the code without plotting it runs smoothly and very fast. Whenever I try to plot the code becomes super slow and each iteration takes ages. What could be the problem?! Thank you very much
using Plots
function f()
x = 1:1:10
y = rand(10)
z = fill(0,10)
d = 0
for i in 1:10000
d = d + 1
z = z .+ 2*d*y
println(z)
p = plot!(x,z)
display(p)
sleep(1000)
end
end
f()