Guide Object Browser Unused Objects
2 次查看(过去 30 天)
显示 更早的评论
I have GUI developed over a period of time and is working fine. In the process I had introduced a few edit boxes and later removed them and deleted the respective callbacks, and creatFcns etc.. Everything is working smoothly now, however, when I look into Object Browser that still shows a number of those edit boxes which are no longer used nor there anywhere in the code. Can I get rid of them from Object Browser?
0 个评论
回答(2 个)
Rutuja Shirali
2015-8-31
I understand that you are still able to view a few edit boxes in the object browser even after you have removed them and their respective callbacks. I tried reproducing this issue on MATLAB R2014b but I was not able to reproduce it. I added a few edit boxes and then removed them and they were no more visible in the object browser.
Make sure that all the references and handles to those edit boxes are removed and you are saving the code after deletion.
Walter Roberson
2015-9-2
Here is some code to test figures and .fig files to verify the reasonableness of callbacks. All kinds of callbacks are examined and a number of different conditions are potentially reported.
You can use
verifyfig('NameOfFig') %that .fig file specifically
verifyfig() %all current figures
verifyfig(figure(17)) %specific graphics object(s)
and there is an optional second argument for excluding some kinds of object types such as uimenu
Sample output:
>> verifyfig('REPORT1')
Callback problems detected
-> in type "uicontrol" object with id 358.0018310546875 Tag "edit1"
--> in type "figure" object with id 532.000244140625 Tag "figure1"
Suspicious callback "Callback" because anonymous function refers to unfound routine "edit1_Callback"
Suspicious callback "CreateFcn" because anonymous function refers to unfound routine "edit1_CreateFcn"
Note: it is common for GUIDE callbacks to not be found. This version of the code is not able to look inside the .m file corresponding to a .fig file in order to determine whether the routines are there. You will need to look over the outputs carefully as the ones you are looking for will be hidden there. On the other hand if you already know the names from the object browser then this tool will help you to track down where the reference to the object is.
There are some enhancements possible to this code, but I just wrote it to answer this Question.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Interactive Control and Callbacks 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!