Is there a way I can use a different file for the callback function for an object I made using GUIDE?

3 vues (au cours des 30 derniers jours)
Is there a way I can use a different file for the callback function using GUIDE like the way I can use a different file when I code a gui file without guide using the 'callback' attribute?

Réponse acceptée

Walter Roberson
Walter Roberson le 3 Juin 2018
Not directly. You have to use the GUIDE-generated callback structure to call upon whatever code you want. GUIDE controls the Callback properties in order to pass the handles structure properly.
I guess you could have the GUI OpenFcn callback change the Callback property to refer directly to the external function, but I'm not sure it is worth the trouble.
  2 commentaires
Amit Singh
Amit Singh le 3 Juin 2018
Modifié(e) : Amit Singh le 3 Juin 2018
The callback function I'm trying to write uses some global variables I've declared. Is there a way to get around this and have my callback still be able to use those variables in guide?
Walter Roberson
Walter Roberson le 3 Juin 2018
global variables are global no matter which file they are used in, provided they are declared as global.
But we do not recommend global variables.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Migrate GUIDE Apps dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by