# Error saving variable

**URL:** <https://discourse.julialang.org/t/error-saving-variable/13201>\
**Category:** New to Julia\
**Created:** [August 10, 2018, 8:19pm UTC](https://discourse.julialang.org/t/error-saving-variable/13201 "2018-08-10T20:19:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelord12](https://avatars.discourse-cdn.com/v4/letter/m/5f8ce5/32.png) [@marcelord12](https://discourse.julialang.org/u/marcelord12)\
**Post date:** [August 10, 2018, 8:19pm UTC](https://discourse.julialang.org/t/error-saving-variable/13201/1 "2018-08-10T20:19:40Z")

</div>

Hi, I’m trying to execute the code bellow. It was written in Julia 0.4.5 and I’m not sure if there is some part of it that is outdated.

# The error happens on line 10: save(“./EAData.jld2”,“X”,X,“U”,U,“D”,D,“Tend”,Tend)

Error evaluating Run.jl  
LoadError: eUndefVarError: save not definede  
while loading /Users/marcelord12/Documents/phd2018/mppo/thesis/MDP/Takeoff/Run.jl, in expression starting on line 10  
include\_string(::String, ::String) at loading.jl:522  
include\_string(::Module, ::String, ::String) at Compat.jl:88  
(::Atom.##112#116{String,String})() at eval.jl:109  
withpath(::Atom.##112#116{String,String}, ::String) at utils.jl:30  
withpath(::Function, ::String) at eval.jl:38  
hideprompt(::Atom.##111#115{String,String}) at repl.jl:67  
macro expansion at eval.jl:106 [inlined]  
(::Atom.##110#114{Dict{String,Any}})() at task.jl:80

==============  
"using JLD2

include(“MonteCarlo.jl”)  
include(“Abstraction.jl”)  
include(“PlotMCSim.jl”)

# Run Monte carlo trials with pilot

RunMCSim(1)  
save(“./PilotData.jld2”,“X”,X,“U”,U,“D”,D,“Tend”,Tend)

#PlotSim()  
GetTransMat!(X,U,D,Tend,TM\_P)

# Run Monte carlo trials with envelope-aware controlle

RunMCSim(2)  
save(“./EAData.jld2”,“X”,X,“U”,U,“D”,D,“Tend”,Tend)

#for i=1:trials  
#PlotSim(i)  
#end

GetTransMat!(X,U,D,Tend,TM\_EA)

#===============================================  
Use Pilot and Envelope-aware transition matrices  
to construct transition matrices for actions  
NOOP and TOGL  
===============================================#

TM\_NOOP = zeros(TotalN_2,TotalN_2)  
TM\_TOGL = zeros(TotalN_2,TotalN_2)

TM\_NOOP[1:TotalN,1:TotalN] = TM\_P[:,:]  
TM\_NOOP[TotalN+1:2_TotalN,  
TotalN+1:2_TotalN] = TM\_EA[:,:]

TM\_TOGL[1:TotalN,TotalN+1:2_TotalN] = TM\_EA[:,:]  
TM\_TOGL[TotalN+1:2_TotalN,1:TotalN] = TM\_P[:,:]

writedlm(“TensorNOOP.txt”,TM\_NOOP)  
writedlm(“TensorTOGL.txt”,TM\_TOGL)"

---

<div class="post-metadata">

**Author:** ![dpsanders](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dpsanders/32/3573_2.png) [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Post date:** [August 10, 2018, 11:01pm UTC](https://discourse.julialang.org/t/error-saving-variable/13201/2 "2018-08-10T23:01:44Z")

</div>

Please [quote your code](https://discourse.julialang.org/t/psa-how-to-quote-code-with-backticks/7530). EDIT: And create a minimal example.
