Hi, All,
I would like to design a class of multi-dimensional arrays that automatically does a number of things. In particular, automatic array extension as the "bsxfun" function does, only without having to call "bsxfun" explicitly. For example: A=myclass(rand(4,4)); b=myclass(rand(4,1)); C=A.*b; where C will be an 4×4 array given by multiplying elementwise each column of A by b, just like C=bsxfun(@times,A,b) will produce for generic arrays A and b.
Moreover, the code L=log(A); should produce logarithm of each element of A, where L is of course an array of myclass. I hope ALL compatible functions and operators should simultaneously be overloaded. How can I do that?
This class potentially could SIGNIFICANTLY simplify MOST of my past MATLAB coding experience. However, So far I have not been able to do that. I have to overload every specific functions one at a time, which is too tedious and error-prone.
Thank you for any answers.
Jin
Best Answer