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

8 vues (au cours des 30 derniers jours)
TARAM
TARAM le 22 Nov 2019
Commenté : TARAM le 22 Nov 2019
__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 commentaires
Walter Roberson
Walter Roberson le 22 Nov 2019
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 le 22 Nov 2019
Ok. It's sad. Thank's Walter for fast comment.

Connectez-vous pour commenter.

Réponses (0)

Catégories

En savoir plus sur Creating, Deleting, and Querying Graphics Objects dans Help Center et File Exchange

Produits


Version

R2017a

Community Treasure Hunt

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

Start Hunting!

Translated by