How to use throwascaller in MATLAB?

Use the throw or throwAsCaller function to have MATLAB ® issue the exception. At this point, MATLAB stores call stack information in the stack field of the MException, exits the currently running function, and returns control to either the keyboard or an enclosing catch block in a calling function.
For More Information Please Refer:
You May Also Like to Read: