MATLAB: Can we define operators in MATLAB

MATLABoop

I started learning OOP in MATLAB and I saw that we can either use the colon(A,B) syntax or simply A:B. This kind of method works for other operators and we may even redefine how they work.
My question is: can we somehow achieve that MATLAB recognises some other symbols we define? For example, I want to use ° for dyadic product in my class and if I typed A°B, dyadic(A,B) would be executed on objects A and B.

Best Answer

As you have seen, you can define the behavior of existing operators, like + or * to operate as you would like them to behave for objects of your class. I use that capability heavily in several of my toolboxes.
But no, you cannot define a completely new character and have MATLAB recognize that as an operator. So you cannot define the operator $ or ° to do something special for your class. This may change one day - one can never rule out language design changes.