MATLAB: Overload only several functions

MATLABoopoverloadingoverriding

Hi,
I am totally new to Matlab OOP. For my program to work, I need to redefine the built-in min, max and abs functions. However, if I declare these three functions as methods, all the other functions like sine, cosine, etc. must be declared so that they act on the defined object. So how can I only redefine (overload) these three functions and let the others unchanged.
Thanks, Zoli

Best Answer

It sounds like you're trying to implement a numeric class. So I'll refer you to matlab own's documentation on subclassing built-in classes
If you derive from a numeric class (e.g. double), you'll automatically get all the methods that apply to double, and you can override the one you want.
Otherwise, there's no other way than you writing all of them, even if it's just a dispatch to the built-in ones.