Programmatically paste into the Matlab Editor

4 Ansichten (letzte 30 Tage)
Matt J
Matt J am 28 Apr. 2025
Beantwortet: Matt J am 3 Mai 2025
I have highlighted a selection of text in the Matlab editor. I would like to run a command, in the command window, that will replace the selected region with text from the clipboard. I know that,
obj = matlab.desktop.editor
creates some sort of interface object to the editor that can do this, but I don't know the precise commands that are needed for pasting over a region.

Akzeptierte Antwort

Matt J
Matt J am 3 Mai 2025
I have created this File Exchange submission,
to make programmatic editor modification easier. To replace from the clipboard, you would do,
editorReplace(clipboard('paste'))

Weitere Antworten (0)

Kategorien

Mehr zu Environment and Settings finden Sie in Help Center und File Exchange

Produkte


Version

R2024b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by