Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -0,0 +1,4 @@
function polyfit(x, y, n)
A = [ float(x[i])^p for i = 1:length(x), p = 0:n ]
A \ y
end

View file

@ -0,0 +1,7 @@
julia> x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
julia> y = [1, 6, 17, 34, 57, 86, 121, 162, 209, 262, 321]
julia> polyfit(x, y, 2)
3-element Array{Float64,1}:
1.0
2.0
3.0