Borrar filtros
Borrar filtros

Repeated Use (reuse) of GUI

1 visualización (últimos 30 días)
Reza
Reza el 27 de Abr. de 2012
I have a simple GUI with several pushbuttons, each calling a separate mfile. The first time after evoking the GUI that I press any of these buttons, the function in the realted mfile are executed. But, ever after I get the following error:
??? Undefined function or method 'FastDD' for input arguments of type 'struct'.
Error in ==> @(hObject,eventdata)FastDD('Kvalue_Callback',hObject,eventdata,guidata(hObject))
??? Error while evaluating uicontrol Callback
where, 'FastDD' being the main GUI and Kvalue being the mfile requested by the second press.
I like to retain the original GUI (FastDD) and use it over and over until I press the exit button. Appreciate any suggestion. Please note that I am a novice in using MATLAB.
  1 comentario
Image Analyst
Image Analyst el 27 de Abr. de 2012
If FastDD is your main (first) GUI, then why does it say this: Undefined function or method 'FastDD'??? Is it calling itself? OK, this first GUI - the one with all the pushbuttons - what is it called? And do you leave that up and running when you push the button on it the second time, or have you run it fresh and new? And what is the name of the m-file that gets run when you push the button? I'd like to figure out if it's the main/first GUI or second m-file that it's complaining about not being able to find. If you're trying to run it fresh and it's complaining about not being able to find the main GUI, then it's likely you cd'ed like Walter mentioned. To check, look at the "Current Folder" in the drop down list of the top of the MATLAB development environment before you run it and see if it's the folder where FastDD lives.

Iniciar sesión para comentar.

Respuesta aceptada

Walter Roberson
Walter Roberson el 27 de Abr. de 2012
Does any of your code use "cd" to change directories? And perhaps fails to "cd" back to the directory that FastDD is in?
  1 comentario
Image Analyst
Image Analyst el 27 de Abr. de 2012
Good guess. Novices often do overuse cd, much to their peril. There's a FAQ entry on it: http://matlab.wikia.com/wiki/FAQ#Where_did_my_file_go.3F_The_risks_of_using_the_cd_function.

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Environment and Settings en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by