Skip to content

Instantly share code, notes, and snippets.

@tdalon
Last active October 10, 2016 18:37
Show Gist options
  • Save tdalon/93089c76623371e19c086c18e10f2714 to your computer and use it in GitHub Desktop.
Save tdalon/93089c76623371e19c086c18e10f2714 to your computer and use it in GitHub Desktop.
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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment