Dear all,
I just want to share a strange behavior which I hope you can reproduce (IJulia environment, Julia 1.0.1). Please find below my code which most of the time leads to a correct plot. But if you run the code repeatedly it ends up plotting something weird or even with an error (ArgumentError: At least one finite value must be provided to formatter).
But this only happens if I define an uninitialized array. If I define a zero filled array, all is fine . Thanks for your help…
using Plots
dt = 1.0/100.0
Fz = Array{Float64}(undef, 50)
t = Array{Float64}(undef, 50)
#Fz = zeros(Float64, 50)
#t = zeros(Float64, 50)
for i = 1:length(Fz)
t[i] = (i-1)*dt
Fz[i] = Fz[i]+sin(pi*fs*t[i])
end
plot(t,Fz)