I was wondering if it is possible to replace this:
function y = par(Z1,Z2)
y=1./(1./Z1+1./Z2);
return;
with some sort of "operator overloading" as in the language C++. So lets say it would become possible to call the function "Z1#Z2" instead of "par(Z1,Z2)"
Z1andZ2would need to be of a custom class, obviously (as in good-practice C++). Start reading about MATLAB's OOP capabilities here. The question you should ask yourself is: is replacing this one function by some nicer syntax really worth the trouble of writing the class?Z1.*Z2./(Z1+Z2)#would need to be a valid and overloadable operator in matlab, which it is not. The same is true for C++ though I'm not entirely sure of that.#is not a C++ operator, let alone an overloadable one :)