GUI briefly loading "old" data into graphs upon program initialization
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
HpW
il 18 Mar 2018
Risposto: Nicolás Aristimuño Padrón
il 9 Giu 2018
Hi. I have a program that runs through a GUI. When the program loads there is a brief period when it appears to be loading "old" data into figures/graphs. This old data at one point in time had been fed into the program during development. This data was pulled from an external file and then graphed, so I am not sure how it still "remembers" it as the file is no longer in the same directory as the current GUI files. I have the same issue with an old logo that was read from a png file - when the program loads for a second or so the old logo still shows up before all the graphs/figures clear and the current logo loads. Any ideas how to remove this issue? Not sure if pictures will really help, but can provide if needed. thanks! h
0 Commenti
Risposta accettata
Walter Roberson
il 18 Mar 2018
The data was in the figure at the time you saved the .fig file, so it will be replotted as the GUI is reinitialized.
You should go back into GUIDE and edit the properties of those axes and save the fig.
11 Commenti
Walter Roberson
il 19 Mar 2018
fig = GUI;
handles = guidata(fig);
cla(handles.axis_1);
cla(handles.logo_axis);
Più risposte (1)
Nicolás Aristimuño Padrón
il 9 Giu 2018
Hey, I'm glad that you could solve the problem. Yesterday it happened the same to me and I saw this post and could solve it too. However, in my gui, I had the "Save" button, as well as the "Zoom" and the "hand". I accidentaly clicked on the Save button of the GUI instead of the Save button in the .fig file that contains the GUI design. Then, everything changed and started to load old data, the same data that was on the GUI when I clicked on that Save Button. Then, in order to solve it I had to reset the axes from the .m file and then click again on that Save button. This is because as the .fig file did change, then I could not solve it from there. The error source was on the GUI that calls the GUI.m file, so that should be solved from there, instead than from the .fig file. Its tricky...
Also, if you have any plot in your axes, then when reset and saving again, these axes will change their tag, so you have to put the tags again from the .fig file. Then is fine!
Hope this non-obvious error and solution can help other people. And remember to NOT include the Save button into the GUI haha
0 Commenti
Vedere anche
Categorie
Scopri di più su Migrate GUIDE Apps in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!