get variables from one file to mainfunction in gui
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Hi, i have main function in m.file, i want to callback some variables in main function that in the form of another m.file. how can i callback that m.file variables in main function, i used guidata(hObject,handles) it displays ??? Error using ==> popupmenu_Callback Too many output arguments.
Error in ==> SERC>popupmenu_Callback at 131 handles.popupmenu_callback = popupmenu_callback
Error in ==> gui_mainfcn at 97 feval(varargin{:});
Error in ==> SERC at 42 gui_mainfcn(gui_State, varargin{:});
Error in ==> @(hObject,eventdata)SERC('popupmenu_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
what is the error in that....
0 commentaires
Réponses (1)
Bob Hamans
le 8 Juil 2011
Just pass the variables between your function as an argument if you do not need intermediate action/calculation.
outvarfunc1 = func1(invarfunc1); outvarfunc2 = func2(outvarfunc1);
Or try to make use of the function assignin to assign a value to variable in a specified workspace of a caller function.
assignin('caller', 'invarfunc2', outvarfunc1);
Or if you want to get really dirty use a global variable.
global varinouteverywhere;
0 commentaires
Voir également
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!