GUI briefly loading "old" data into graphs upon program initialization
4 次查看(过去 30 天)
显示 更早的评论
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 个评论
采纳的回答
Walter Roberson
2018-3-18
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 个评论
Walter Roberson
2018-3-19
fig = GUI;
handles = guidata(fig);
cla(handles.axis_1);
cla(handles.logo_axis);
更多回答(1 个)
Nicolás Aristimuño Padrón
2018-6-9
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 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!