How to use variables of one function into another functions in GUI?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I am a newbie to GUI. I want to create a GUI in which with the help of data entered by user, I will make some initial calculations. Now, I want to use that calculation for other pushbuttons and popupmenu etc.. Please tell me method to do this. With regards Bharat Garg
0 commentaires
Réponse acceptée
Image Analyst
le 29 Déc 2012
See the faq: http://matlab.wikia.com/wiki/FAQ#How_can_I_share_data_between_callback_functions_in_my_GUI.28s.29.3F
Use GUIDE to build your user interface.
3 commentaires
Jan
le 29 Déc 2012
A forum can only assist you to solve the problem by your own. When you want somebody to create the program for you, hire a programmer.
Therefore I suggest to try it, and post a specific question about the occurring problem. Then you will most likely get help here, to solve the single problems step by step.
Image Analyst
le 29 Déc 2012
You're kidding me - 10 days? Here's a snippet that may help you:
% Ask user for a number.
defaultValue = 45;
titleBar = 'Enter a value';
userPrompt = 'Enter the integer';
caUserInput = inputdlg(userPrompt, titleBar, 1, {num2str(defaultValue)});
if isempty(caUserInput),return,end; % Bail out if they clicked Cancel.
integerValue = round(str2double(cell2mat(caUserInput)));
% Check for a valid integer.
if isnan(integerValue)
% They didn't enter a number.
% They clicked Cancel, or entered a character, symbols, or something else not allowed.
integerValue = defaultValue;
message = sprintf('I said it had to be an integer.\nI will use %d and continue.', integerValue);
uiwait(warndlg(message));
end
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Migrate GUIDE Apps 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!