Open callback function script in Editor for a specific component in GUI

1 回表示 (過去 30 日間)
TARAM
TARAM 2019 年 11 月 22 日
コメント済み: TARAM 2019 年 11 月 22 日
__Hi everybody. I created GUI in script. I have a lot of components and a lot of callback functions in different files. Is it possible to open callback function for specific component i see in GUI. Of course i can find this function by myself among bunch of files. But may be there is a button to open it fast in editor for a component selected in GUI.
  2 件のコメント
Walter Roberson
Walter Roberson 2019 年 11 月 22 日
This turns out to be more difficult than you would expect.
Mathworks Support tells me that there is no interface available that can report whether a particular file defines a particular function. That means that you cannot iterate between all of your files asking for each "are you the file that defines the function I am looking for" and opening the file for editing if it is.
Instead you have to do text processing, such as searching for "function" followed by the name of the function. This is risky because you have to account for quoted strings and multiple styles of comments.
There is another possibility: someone (Stephen I think) hacked one of the Mathworks provided code analysis scripts to be able to analyze code. In theory that could be hacked even further to detect function definitions and figure out line numbers.
TARAM
TARAM 2019 年 11 月 22 日
Ok. It's sad. Thank's Walter for fast comment.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by