Get current file opened in MATLAB Editor
function file=EditorGetFile
% EditorGetFile get current file opened in Editor
%
% SYNTAX:
% file=EditorGetFile
% OUTPUT:
% file (char): fullpath
edhandle = com.mathworks.mlservices.MLEditorServices.getEditorApplication;
file = edhandle.getActiveEditor.getDocument.getFilename;
file = char(file);