Plotting Test-checkpoint



In [1]:
push!(LOAD_PATH, "C:\\Users\\Ben\\Documents\\Programs\\log1\\julia")
using PyPlot
using Sum
using When


INFO: Loading help data...

In [2]:
Σ([1,2,3])


Out[2]:
6

Use of $\Sigma$ sum function for plotting:


In [12]:
x = range(0, Σ(range(1,5)))
y = sin(x)

plot(x,y)


Out[12]:
1-element Array{Any,1}:
 PyObject <matplotlib.lines.Line2D object at 0x000000001D1EEB00>

The $\Sigma$ function is defined as follows:


In [ ]:
function Σ(list) # List summation
  sum = 0
  for i in list
    sum = sum + list[i]
  end
  return sum
end

In [ ]: