Put your version of harmonic
into a folder @double
, and make sure that your folder @double
is above \toolbox\symbolic\symbolic\@double
on the path (this new double.harmonic
is from Symbolic Toolbox).
That will force your function to become a method of double
i.e. it will be double.harmonic
, rather than a generic function harmonic
. When deciding which thing to dispatch to, MATLAB will consider methods first, then generic functions later. Since your double.harmonic
and the other one are both methods, and yours is ahead on the path, yours will win. BAM - eat that, MATLAB!