In [1]:
##
1+1
Out[1]:
2
In [2]:
##
using Plots
pyplot()
plot(randn(5), randn(5))
Out[2]:
In [3]:
##
using Random
Random.seed!(0)
pyplot(size=(200,200))
n = 50
x = round.(range(1, 5.5, length=n) .+ 0.1.*(2*rand(n).-1),digits=2)
#x = round.(5*rand(n).+1, digits=2)
y = round.(5*x.+1 .+ 5*(2*rand(n).-1), digits=2)
scatter(x,y, leg=false)
xlabel!("x")
ylabel!("y")
Out[3]:
In [4]:
##
A = [ones(n) x]
b = y
c = A\b 
Out[4]:
2-element Array{Float64,1}:
 1.6872087828969176
 4.935689998490376