Julia’s version of varargin is multiple dispatch. I mean, not literally, but in general you don’t just customize behavior of functions by the number of inputs, you just define multiple methods.
function f(x)
...
end
function f(x, y)
...
end
For your particular example, just overload the functions you need
You need to provide the error message for me to help you more.
But overall, I highly suggest you read the documentation more. It seems like you are trying to port highly specific matlab idioms to Julia. If you are encountering problems with implementing operate or writing a new method for mean, the docs will help.
Sorry, I was not even capable of formulating my running example using operate.
For studying the documentation, you are definitively right.
Talk to you tomorrow.
In julia v0.5 there is an especially slick way to do this due to the fact that closures represent their captured variables as object fields automatically. For example:
julia> function Person(name, age)
getName() = name
getAge() = age
getOlder() = (age+=1)
()->(getName;getAge;getOlder)
end
Person (generic function with 1 method)
julia> o = Person("bob", 26)
(::#3) (generic function with 1 method)
julia> o.getName()
"bob"
julia> o.getAge()
26
julia> o.getOlder()
27
julia> o.getAge()
27
plus the following comment with a possible improvement.
I think I am done here. Thanks for your company and patience!