How can I make such that every method call to a class is routed through a wrapper
Is there a way to automatically wrap every method call to a class in a wrapper function in MATLAB? For example, suppose I have a class with methods method1 and method2 and a wrapper function wrapper_func. The wrapper_func should:
Print the inputs and the name of the method.
Call the actual method (e.g., method1).
Print the outputs of the method.
When I create an object obj of this class and call obj.method1, it should implicitly call wrapper_func with method1 so that the wrapper function handles the input/output printing and method execution. How can this be achieved in MATLAB?Is there a way to automatically wrap every method call to a class in a wrapper function in MATLAB? For example, suppose I have a class with methods method1 and method2 and a wrapper function wrapper_func. The wrapper_func should:
Print the inputs and the name of the method.
Call the actual method (e.g., method1).
Print the outputs of the method.
When I create an object obj of this class and call obj.method1, it should implicitly call wrapper_func with method1 so that the wrapper function handles the input/output printing and method execution. How can this be achieved in MATLAB? Is there a way to automatically wrap every method call to a class in a wrapper function in MATLAB? For example, suppose I have a class with methods method1 and method2 and a wrapper function wrapper_func. The wrapper_func should:
Print the inputs and the name of the method.
Call the actual method (e.g., method1).
Print the outputs of the method.
When I create an object obj of this class and call obj.method1, it should implicitly call wrapper_func with method1 so that the wrapper function handles the input/output printing and method execution. How can this be achieved in MATLAB? wrapper, class MATLAB Answers — New Questions