In [4]:
# li_ikegami
# gridを順番ばらばらでもいいようにした
# grid sizeとvalue sizeが異なる時にerrorを吐くようにした
# 範囲外の値をいれるとerror

function li_ikegami(grid, vals)
    n = length(grid)
    m = length(vals)
    
    if n != m
        print("grid size and value siza is not equal")
    end
    
    mat = [grid vals]
    mat = sortrows(mat, by = x->(x[1]))
    mat = transpose(mat)
    
    grid = mat[1, :]
    vals = mat[2, :]
    
    slope = Array(Float64, n-1)
    for i in 1: (n-1)
        temp_slope = (vals[i] - vals[i+1]) / (grid[i] - grid[i+1])
        slope[i] = temp_slope
    end
    function approx(x_val)
        
        if x_val > maximum(grid)
            return print("too big value ...")
        end
        
        if x_val < minimum(grid)
            return print("too small value ...")
        end
        
        interval = 1
        for j in 1:(n-1)
            if x_val > grid[j+1]
                interval += 1
            else break
            end
        end
        return slope[interval] * (x_val - grid[interval]) + vals[interval]
    end
    
    function approx{T<:Real}(x::AbstractVector{T})
        n = length(x)
        out = Array(Float64, n)
        for i in 1:n
            out[i] = approx(x[i])
        end
        return out
    end
    
    return approx
end


Out[4]:
li_ikegami (generic function with 1 method)

In [5]:
grid = [1,2] 
vals = [2,0]
f = li_ikegami(grid, vals)
f(1.25)


Out[5]:
1.5

In [6]:
grid2 = [1,2,6,4,5]
vals2 = [3,2,3,1,7]
g = li_ikegami(grid2, vals2)
g([2.3, 3.1])


Out[6]:
2-element Array{Float64,1}:
 1.85
 1.45

In [ ]:


In [4]:
a = [1,2,3]
a[1]


Out[4]:
1

In [9]:
# お試し
function test(n)
    function test_2(m)
        return m^n
    return test_2
    end
end


Out[9]:
test (generic function with 1 method)

In [10]:
a = test(5)
a(2)


Out[10]:
32

In [52]:
b = Array(Float64, 3)
b[1] = 1
b


Out[52]:
3-element Array{Float64,1}:
 1.0         
 2.18565e-314
 2.18571e-314

In [40]:
Array[3,5]


Out[40]:
2-element Array{Any,1}:
 3
 5

In [48]:
Any[Float64, 3]


Out[48]:
2-element Array{Any,1}:
  Float64
 3       

In [57]:
Any[4]


Out[57]:
1-element Array{Any,1}:
 4

In [63]:
Array[Float64][2,4]


LoadError: MethodError: `convert` has no method matching convert(::Type{Array{T,N}}, ::Type{Float64})
This may have arisen from a call to the constructor Array{T,N}(...),
since type constructors fall back to convert methods.
Closest candidates are:
  Array{T,N}(::Type{T}, !Matched::NTuple{N,Int64})
  Array{T}(::Type{T}, !Matched::Integer)
  Array{T}(::Type{T}, !Matched::Integer, !Matched::Integer)
  ...
while loading In[63], in expression starting on line 1

 in getindex at array.jl:167

In [70]:
Array(Float64, 10)


Out[70]:
10-element Array{Float64,1}:
 5.80441e286 
 1.29092e295 
 3.57723e-57 
 3.06927e223 
 7.94633e-61 
 1.29092e295 
 5.12099e-320
 0.0         
 0.0         
 0.0         

In [84]:
slope = Array(Float64, 11)
fill!(slope, 1.0)


Out[84]:
11-element Array{Float64,1}:
 1.0
 1.0
 1.0
 1.0
 1.0
 1.0
 1.0
 1.0
 1.0
 1.0
 1.0

In [109]:
grid = [1,2] 
vals = [2,0]
mat = [grid vals]
mat


Out[109]:
2x2 Array{Int64,2}:
 1  2
 2  0

In [97]:
sort(vals)


Out[97]:
2-element Array{Int64,1}:
 0
 2

In [101]:
# round はおそらく丸め込み
A = round(randn(100,4))


Out[101]:
100x4 Array{Float64,2}:
  0.0   0.0  -0.0   1.0
 -0.0  -1.0  -1.0   0.0
 -0.0   0.0   1.0   0.0
  1.0  -1.0   0.0  -0.0
  1.0  -1.0   1.0  -0.0
 -0.0  -0.0  -0.0   1.0
 -2.0   0.0   0.0   0.0
 -1.0   2.0   1.0   0.0
  1.0  -2.0  -2.0   1.0
 -1.0   2.0   1.0   0.0
  2.0  -0.0   1.0  -1.0
 -1.0  -0.0   0.0  -1.0
 -1.0  -2.0  -2.0   1.0
  ⋮                    
  1.0  -2.0   0.0  -1.0
 -0.0  -0.0  -1.0  -2.0
 -3.0   1.0   0.0   0.0
 -1.0   0.0   2.0   1.0
  1.0   2.0   1.0   0.0
 -1.0  -1.0   1.0   0.0
 -0.0  -1.0  -0.0  -1.0
  1.0   2.0   1.0   3.0
 -1.0   2.0  -1.0   2.0
 -0.0   1.0   1.0   0.0
  1.0   1.0   0.0  -1.0
  1.0  -3.0  -0.0   1.0

In [102]:
sortrows(randn(2,3), by=x -> (x[2]))


Out[102]:
2x3 Array{Float64,2}:
 0.496597  -0.169945  1.80949 
 0.222282   0.783163  0.495988

In [106]:
seed = 1234
randn(2,3)


Out[106]:
2x3 Array{Float64,2}:
 -0.144787   -0.609347  0.7378  
 -0.0878836  -1.30798   0.379081

In [107]:
seed = 1234
sortrows(randn(2,3), by=x -> (x[2]))


Out[107]:
2x3 Array{Float64,2}:
  0.987639  0.892506  -1.68416 
 -1.47808   0.908685  -0.157456

In [125]:
# これでいけるね
# この後transposeすれば良い
grid2 = [1,2,3,5,4]
vals2 = [3,2,3,1,5]
mat = [grid2 vals2]
mat = sortrows(mat, by=x->(x[1]))


Out[125]:
5x2 Array{Int64,2}:
 1  3
 2  2
 3  3
 4  5
 5  1

In [132]:
# 行の取り出し方
mat[1, :]


Out[132]:
1x2 Array{Int64,2}:
 1  3

In [4]:
a = [3,2,1]
maximum(a)


Out[4]:
3

In [1]:
Pkg.add("Images")
Pkg.add("DataFrames")
using Images
using DataFrames


INFO: Cloning cache of ColorVectorSpace from git://github.com/JuliaGraphics/ColorVectorSpace.jl.git
INFO: Cloning cache of Graphics from git://github.com/JuliaLang/Graphics.jl.git
INFO: Cloning cache of Images from git://github.com/timholy/Images.jl.git
INFO: Cloning cache of SIUnits from git://github.com/Keno/SIUnits.jl.git
INFO: Cloning cache of TexExtensions from git://github.com/Keno/TexExtensions.jl.git
INFO: Cloning cache of Zlib from git://github.com/dcjones/Zlib.jl.git
INFO: Installing ColorVectorSpace v0.1.4
INFO: Installing Graphics v0.1.3
INFO: Installing Images v0.5.4
INFO: Installing SIUnits v0.0.6
INFO: Installing TexExtensions v0.0.3
INFO: Installing Zlib v0.1.12
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of Images
INFO: Use `Pkg.update()` to get the latest versions of your packages
INFO: No packages to install, update or remove
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of DataFrames
INFO: Use `Pkg.update()` to get the latest versions of your packages
INFO: Precompiling module Images...
INFO: Recompiling stale cache file /Users/susu/.julia/lib/v0.4/DataFrames.ji for module DataFrames.
INFO: Recompiling stale cache file /Users/susu/.julia/lib/v0.4/DataArrays.ji for module DataArrays.
INFO: Recompiling stale cache file /Users/susu/.julia/lib/v0.4/SortingAlgorithms.ji for module SortingAlgorithms.
INFO: Recompiling stale cache file /Users/susu/.julia/lib/v0.4/Docile.ji for module Docile.
WARNING: New definition 
    .-(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:285
is ambiguous with: 
    .-(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:40.
To fix, define 
    .-(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, DataArrays.DataArray})
before the new definition.
WARNING: New definition 
    ./(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:285
is ambiguous with: 
    ./(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:55.
To fix, define 
    ./(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, DataArrays.DataArray})
before the new definition.
WARNING: New definition 
    +(AbstractArray, DataArrays.DataArray) at /Users/susu/.julia/v0.4/DataArrays/src/operators.jl:326
is ambiguous with: 
    +(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:18.
To fix, define 
    +(Images.AbstractImageDirect, DataArrays.DataArray)
before the new definition.
WARNING: New definition 
    +(AbstractArray, DataArrays.AbstractDataArray) at /Users/susu/.julia/v0.4/DataArrays/src/operators.jl:349
is ambiguous with: 
    +(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:18.
To fix, define 
    +(Images.AbstractImageDirect, DataArrays.AbstractDataArray)
before the new definition.
WARNING: New definition 
    -(DataArrays.DataArray, AbstractArray) at /Users/susu/.julia/v0.4/DataArrays/src/operators.jl:326
is ambiguous with: 
    -(AbstractArray, Images.AbstractImageDirect) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:37.
To fix, define 
    -(DataArrays.DataArray, Images.AbstractImageDirect)
before the new definition.
WARNING: New definition 
    -(AbstractArray, DataArrays.DataArray) at /Users/susu/.julia/v0.4/DataArrays/src/operators.jl:326
is ambiguous with: 
    -(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:35.
To fix, define 
    -(Images.AbstractImageDirect, DataArrays.DataArray)
before the new definition.
WARNING: New definition 
    -(DataArrays.AbstractDataArray, AbstractArray) at /Users/susu/.julia/v0.4/DataArrays/src/operators.jl:349
is ambiguous with: 
    -(AbstractArray, Images.AbstractImageDirect) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:37.
To fix, define 
    -(DataArrays.AbstractDataArray, Images.AbstractImageDirect)
before the new definition.
WARNING: New definition 
    -(AbstractArray, DataArrays.AbstractDataArray) at /Users/susu/.julia/v0.4/DataArrays/src/operators.jl:349
is ambiguous with: 
    -(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:35.
To fix, define 
    -(Images.AbstractImageDirect, DataArrays.AbstractDataArray)
before the new definition.
WARNING: New definition 
    .+(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}, AbstractArray...) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:297
is ambiguous with: 
    .+(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:22.
To fix, define 
    .+(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, DataArrays.DataArray})
before the new definition.
WARNING: New definition 
    .<(AbstractArray{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:330
is ambiguous with: 
    .<(Images.AbstractImageDirect{Bool, N<:Any}, AbstractArray{Bool, N<:Any}) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:177.
To fix, define 
    .<(Images.AbstractImageDirect{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}})
before the new definition.
WARNING: New definition 
    .<(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:285
is ambiguous with: 
    .<(Images.AbstractImageDirect{Bool, N<:Any}, AbstractArray{Bool, N<:Any}) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:177.
To fix, define 
    .<(Images.AbstractImageDirect{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}})
before the new definition.
WARNING: New definition 
    .<(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:285
is ambiguous with: 
    .<(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:178.
To fix, define 
    .<(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, DataArrays.DataArray})
before the new definition.
WARNING: New definition 
    convert(Type{Array{#S<:Any, N<:Any}}, DataArrays.DataArray{#T<:Any, #N<:Any}) at /Users/susu/.julia/v0.4/DataArrays/src/dataarray.jl:357
is ambiguous with: 
    convert(Type{Array{#T<:ColorTypes.Colorant, N<:Any}}, AbstractArray{#S<:Any, #n<:Any}) at /Users/susu/.julia/v0.4/Images/src/core.jl:396.
To fix, define 
    convert(Type{Array{_<:ColorTypes.Colorant, N<:Any}}, DataArrays.DataArray{#T<:Any, #N<:Any})
before the new definition.
WARNING: New definition 
    .*(Union{DataArrays.PooledDataArray, DataArrays.DataArray}, AbstractArray...) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:295
is ambiguous with: 
    .*(AbstractArray, Images.AbstractImageDirect) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:52.
To fix, define 
    .*(Union{DataArrays.PooledDataArray, DataArrays.DataArray}, Images.AbstractImageDirect)
before the new definition.
WARNING: New definition 
    .*(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}, AbstractArray...) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:295
is ambiguous with: 
    .*(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:51.
To fix, define 
    .*(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, DataArrays.DataArray})
before the new definition.
WARNING: New definition 
    .==(AbstractArray{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:330
is ambiguous with: 
    .==(Images.AbstractImageDirect{Bool, N<:Any}, AbstractArray{Bool, N<:Any}) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:181.
To fix, define 
    .==(Images.AbstractImageDirect{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}})
before the new definition.
WARNING: New definition 
    .==(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:285
is ambiguous with: 
    .==(Images.AbstractImageDirect{Bool, N<:Any}, AbstractArray{Bool, N<:Any}) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:181.
To fix, define 
    .==(Images.AbstractImageDirect{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}})
before the new definition.
WARNING: New definition 
    .==(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:285
is ambiguous with: 
    .==(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:182.
To fix, define 
    .==(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, DataArrays.DataArray})
before the new definition.
WARNING: New definition 
    .>(AbstractArray{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:330
is ambiguous with: 
    .>(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:179.
To fix, define 
    .>(Images.AbstractImageDirect{Bool, N<:Any}, Union{DataArrays.DataArray{Bool, N<:Any}, DataArrays.PooledDataArray{Bool, R<:Integer, N<:Any}})
before the new definition.
WARNING: New definition 
    .>(AbstractArray, Union{DataArrays.PooledDataArray, DataArrays.DataArray}) at /Users/susu/.julia/v0.4/DataArrays/src/broadcast.jl:285
is ambiguous with: 
    .>(Images.AbstractImageDirect, AbstractArray) at /Users/susu/.julia/v0.4/Images/src/algorithms.jl:179.
To fix, define 
    .>(Images.AbstractImageDirect, Union{DataArrays.PooledDataArray, DataArrays.DataArray})
before the new definition.

In [2]:
using TestImages
img = testimage("mandrill")


LoadError: ArgumentError: TestImages not found in path
while loading In[2], in expression starting on line 1

 in require at /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib

In [4]:
using Images
using TestImages

In [5]:
img = testimage("mandrill")


Library QuartzImageIO is not installed but can load format: FileIO
WARNING: FileIO.NotInstalledError(:QuartzImageIO,"")
 in checked_import at /Users/susu/.julia/v0.4/FileIO/src/loadsave.jl:12
 in load at /Users/susu/.julia/v0.4/FileIO/src/loadsave.jl:79
 in load at /Users/susu/.julia/v0.4/FileIO/src/loadsave.jl:42
 in testimage at /Users/susu/.julia/v0.4/TestImages/src/TestImages.jl:22
 in include_string at loading.jl:282
 in execute_request_0x535c5df2 at /Users/susu/.julia/v0.4/IJulia/src/execute_request.jl:182
 in eventloop at /Users/susu/.julia/v0.4/IJulia/src/IJulia.jl:142
 in anonymous at task.jl:447
Trying next loading library! Please report this issue on the Github page for QuartzImageIO
WARNING: FileIO.NotInstalledError(:ImageMagick,"")
 in checked_import at /Users/susu/.julia/v0.4/FileIO/src/loadsave.jl:12
 in load at /Users/susu/.julia/v0.4/FileIO/src/loadsave.jl:79
 in load at /Users/susu/.julia/v0.4/FileIO/src/loadsave.jl:42
 in testimage at /Users/susu/.julia/v0.4/TestImages/src/TestImages.jl:22
 in include_string at loading.jl:282
 in execute_request_0x535c5df2 at /Users/susu/.julia/v0.4/IJulia/src/execute_request.jl:182
 in eventloop at /Users/susu/.julia/v0.4/IJulia/src/IJulia.jl:142
 in anonymous at task.jl:447
.File{FileIO.DataFormat{:TIFF}}("/Users/susu/.julia/v0.4/TestImages/images/mandrill.tiff")
should we install QuartzImageIO for you? (y/n):
STDIN> 
 is not a valid choice. Try typing y or n
should we install QuartzImageIO for you? (y/n):
STDIN> 
 is not a valid choice. Try typing y or n
should we install QuartzImageIO for you? (y/n):
STDIN> 
 is not a valid choice. Try typing y or n
should we install QuartzImageIO for you? (y/n):
STDIN> y
INFO: Start installing QuartzImageIO...
INFO: Cloning cache of QuartzImageIO from git://github.com/JuliaIO/QuartzImageIO.jl.git
INFO: Installing QuartzImageIO v0.1.2
INFO: Package database updated
INFO: METADATA is out-of-date — you may not have the latest version of QuartzImageIO
INFO: Use `Pkg.update()` to get the latest versions of your packages

In [7]:
img = testimage("mandrill")
show(img)


INFO: Precompiling module QuartzImageIO...
RGB Images.Image with:
  data: 512x512 Array{ColorTypes.RGB{FixedPointNumbers.UFixed{UInt8,8}},2}
  properties:
    imagedescription: <suppressed>
    spatialorder:  x y
    pixelspacing:  1 1

In [13]:
using Plotly

In [14]:
trace1 = [
  "x" => [1, 2, 3, 4],
  "y" => [10, 15, 13, 17],
  "type" => "scatter"
]
trace2 = [
  "x" => [1, 2, 3, 4],
  "y" => [16, 5, 11, 9],
  "type" => "scatter"
]

response = Plotly.plot([trace1, trace2], ["filename" => "basic-line", "fileopt" => "overwrite"])


WARNING: deprecated syntax "[a=>b, ...]" at In[14]:2.
Use "Dict(a=>b, ...)" instead.

WARNING: deprecated syntax "[a=>b, ...]" at In[14]:7.
Use "Dict(a=>b, ...)" instead.

WARNING: deprecated syntax "[a=>b, ...]" at In[14]:12.
Use "Dict(a=>b, ...)" instead.
LoadError: Please 'signin(username, api_key)' before proceeding. See
            http://plot.ly/API for help!
while loading In[14], in expression starting on line 12

In [15]:
using PyPlot


LoadError: InitError: error compiling __init__: could not load library "/Users/susu/anaconda/lib/libpython2.7.dylib"
dlopen(/Users/susu/anaconda/lib/libpython2.7.dylib.dylib, 1): image not found
during initialization of module PyCall
while loading In[15], in expression starting on line 1

In [26]:
using Gadfly
include("linear_interp.jl")
set_default_plot_size(18cm, 12cm)
grid = [1,2] 
vals = [2,0]
plot(x=grid, y=vals)


Out[26]:
x -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 0.00 0.05 0.10 0.15 0.20 0.25 0.30 0.35 0.40 0.45 0.50 0.55 0.60 0.65 0.70 0.75 0.80 0.85 0.90 0.95 1.00 1.05 1.10 1.15 1.20 1.25 1.30 1.35 1.40 1.45 1.50 1.55 1.60 1.65 1.70 1.75 1.80 1.85 1.90 1.95 2.00 2.05 2.10 2.15 2.20 2.25 2.30 2.35 2.40 2.45 2.50 2.55 2.60 2.65 2.70 2.75 2.80 2.85 2.90 2.95 3.00 0 1 2 3 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 -2.5 -2.0 -1.5 -1.0 -0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 -2.0 -1.9 -1.8 -1.7 -1.6 -1.5 -1.4 -1.3 -1.2 -1.1 -1.0 -0.9 -0.8 -0.7 -0.6 -0.5 -0.4 -0.3 -0.2 -0.1 0.0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.3 2.4 2.5 2.6 2.7 2.8 2.9 3.0 3.1 3.2 3.3 3.4 3.5 3.6 3.7 3.8 3.9 4.0 -2 0 2 4 -2.0 -1.8 -1.6 -1.4 -1.2 -1.0 -0.8 -0.6 -0.4 -0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0 2.2 2.4 2.6 2.8 3.0 3.2 3.4 3.6 3.8 4.0 y

In [28]:
include("linear_interp.jl")
grid = [1,2] 
vals = [2,0]
f = li_ikegami(grid, vals)
f(1.5)


LoadError: invalid redefinition of constant f
while loading In[28], in expression starting on line 4

In [ ]: