get variables from one file to mainfunction in gui
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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 Commenti
Risposte (1)
Bob Hamans
il 8 Lug 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 Commenti
Vedere anche
Categorie
Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!