Calling a opening function in a programmatic GUI
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I designed a GUI programmatically that gets called in a script with an input argument.
For initalising before any of the GUI gets executed I would like to call an opening function and an output function, in the same way it's done, when I design a GUI with the tool GUIDE.
I have the suspicion, that my opening function doesn't gets executed and so it's impossible for me to work with passed input arguments from the script
Is that possible?
2 commentaires
Réponses (1)
Krishna Zanwar
le 26 Fév 2019
Hi,
The error in this code is caused in the function calc_button_callback as the variables a, b, c are not initiated. I am not sure what to replace these variables with, so I just put a constant there.
There is no output to the function gui. You can just remove the varargout from the function declaration or you have to make sure that you set some value to varargout.
If these two changes are made the errors in the function are resolved.
Varargin is used when you don’t know how many input arguments to expect when the function is called. Varargin acts as a Cell array of all the input arguments no matter how many are called. But if you have a difficulty working with varargin you can just replace it with normal variables as you already know how many variables are called. Same goes with varargout.
There are some basic coding mistakes in your code which need to be corrected.
For example, while defining the calc_button_callback you are taking handles as an input but you are not passing handles while calling the function.
Here are some links that should help you understand the functions properly.
Voir également
Catégories
En savoir plus sur Whos dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!