Programmatically paste into the Matlab Editor

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.

 채택된 답변

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Environment and Settings에 대해 자세히 알아보기

제품

릴리스

R2024b

질문:

2025년 4월 28일

답변:

2025년 5월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by