how to implement "Evaluate or Open Code You Select" in everywhere?

조회 수: 1 (최근 30일)
HaveF
HaveF 2012년 8월 17일
I want to implement(and add some features to) the function "Evaluate Selections" where you select your code and click you right mouse.
In editor, I can do this:
editorObject = matlab.desktop.editor.getActive;
eval([editorObject.SelectedText ';']);
but in command window, help window, how can I do that?

채택된 답변

Jan
Jan 2012년 8월 18일
편집: Jan 2012년 8월 19일
You can't.
[EDITED]
Expanding the GUI capabilities of Matlab's user-interface is possible with undocumented and unsupported methods. But it is likely, that different methods are needed for different Matlab versions. Therefore the next update would make all your work useless or could even cause severe bugs.
It seems to be more promising, if you create a dedicated function, which evaluates code, which is copied into the clipboard. The needs 2 or 3 additional mouse clicks, but does not depend on the Matlab version.
  댓글 수: 1
HaveF
HaveF 2012년 8월 19일
Thank for your reply. Or, can I get the java code of right-click menu(Evaluate Selection)? Something like Yair Altmam's undocumented Matlab?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by