Note that default arguments in Julia can simplify this further. Often you have Matlab code like
function y = foo(x, z)
if nargin < 2
z = ...default value...
end
....
end
Which in Julia can be simplified to
function foo(x, z = ...default value...)
...
end
This is equivalent to declaring two functions, foo(x,z) and foo(x) = foo(x,
...default value...)
