Documentation of Editor API
34 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Jan
il 11 Nov 2017
Commentato: LOKENDRA KUMAR AGRAWAL
il 28 Ago 2023
There is an API to interact with the files opened in the editor, see e.g.
matlab.desktop.editor.getAll
But how can I find the corresponding docs or further explanations? These trials are not successful in R2016b:
docsearch editor
docsearch editor api
docsearch matlab.desktop.editor
docsearch getAll
doc matlab.desktop.editor.getAll % [EDITED: This DOES work!]
doc matlab.desktop.editor % This also - See Michelle's answer
Searching in the net does not find the official documentation also, e.g. asking Google for "matlab.desktop.editor.getAll" provides these links on top:
- https://www.mathworks.com/matlabcentral/answers/10577-how-to-get-a-list-of-all-open-files-in-matlab-editor
- https://www.mathworks.com/matlabcentral/answers/16389-how-can-i-save-a-list-of-open-m-files
- https://www.mathworks.com/matlabcentral/answers/119438-how-can-i-create-a-list-of-m-files-currently-open-in-the-editor
- ...
- Is this API documented?
- If so, where do I find an exhaustive documentation?
- How could I find this by my own?
PS. What a pity that the powerful feature of running macros in the editor has been removed after Matlab version 5.3! FEX: EditorMacro does not work as stable as I need it.
0 Commenti
Risposta accettata
Michelle Hirsch
il 17 Nov 2017
These functions are documented through their source code help, though there are no reference pages. Our intention is that the editor interface is fully supported.
You can use help or doc to get help on any function in the package. Doc just opens the help in the documentation browser. You can also get a listing of all of the documented functionality by calling
doc matlab.desktop.editor
4 Commenti
Walter Roberson
il 25 Ago 2019
Ian,
You need to extract an active instance instance and work with it.
allinstances = matlab.desktop.editor.getAll;
now examine {allinstances.FileName} to figure out which if the instances is the one that is of interest to you. Supposing it is at offset idx, then
allinstances(idx).save() or .saveAs() or .close())
Più risposte (0)
Vedere anche
Categorie
Scopri di più su Environment and Settings in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!