I am newbie in Julia language, and the tutorial is not very deep yet and I didn\'t understand what is the best way to pass a parameter list of a function. My function looks like
What you want to do really is passing an instance of a data structure (composite data type) to your function. to do this, first design your data type:
type MyType
x::Vector
a
b
c
end
and implement dxtd
function:
function dxdt(val::MyType)
return val.a*val.x^2 + val.b*val.x + val.c
end
then some where in your code you make an instance of MyType like this:
myinstance = MyType([],0.0,0.0,0.0)
you can update myinstance
myinstance.x = [1.0,2.8,9.0]
myinstance.a = 5
and at the end when myinstance
get ready for dxxt
dxdt(myinstance)