Guide GUI deleted associated *.m file
Mostrar comentarios más antiguos
I created a guide GUI which took me ~6-7 hours as I had not worked with the gui before and it seems matlab ended up deleting the contents of the associated m-file. Though it was first gui I think it was fairly clean and I was not doing anything weird with handles.
Contents: - Edit box, pushbutton (*3) for setting directories/files - 3 edit boxes for x,y,z of a point - uitable with 5 columns. 2 of the columns had choice lists which were filled based on the input files - listbox which was used to output things from the code (I over-rode the built in fprintf so all fprintf statements went to this listing window)
The problem started when I tried to add a callback function to the uitable. I went in the property inspector and added it by clicking the autofill button on the left and then saved the .fig file. It gave an error about referencing a nonstructured array something or other. I tried deleting the callback from the property inspector to no avail. I tried running the *.m file to use the gui and see if it still worked but nothing happened (no errors, but it didn't run). I decided to close everything and reopen matlab. When I did so the contents of the m file (which was definitely saved previously.... like last week and 5 times today) was gone. Not a single character is there. I'm at a loss for what happened here. I don't have a backup of the .m file.
Thoughts?
1 comentario
Jeffrey
el 24 de Nov. de 2014
Respuestas (2)
Orion
el 24 de Nov. de 2014
0 votos
it seems to me that you had created an object which is badly configured in the gui or which existed but you deleted it in the gui and the corresponding callbacks are still in the code.
so when you regenerate the code, guide creates the structure handles with the tag of all the controls, axes,... and it analyses the code if this one already exists in order to complete it and if there are some differences between the handles in the gui and the callbacks in the code, you can have the kind of error you get.
I don't know your gui, neither the code, and less the previous versions. so it will be pretty hard to resolve at distance.
I'd say, you should try to debug this way.
- List all the control / axes / ... in your gui and see if their is a corresponding callback.
- check if every callback in the code corresponds to a graphic object.
Categorías
Más información sobre Interactive Control and Callbacks en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!