remove unused callbacks from GUI m files

Hello all,
I am using both MATLAB 2011a and MATLAB 2012b and I have large .m files corresponding to the GUI`s that I have created.
Sadly there are a lot of callbacks that were created automatically and that means ugly and big code size.
The function "name_Callback" might be unused is the message
Is there a way to safely remove these functions ? If I just delete them from my .m file will the GUI still work perfectly or is there a slight chance it won't?
Thanks in advance,
Adrian.

댓글 수: 1

Daniel Shub
Daniel Shub 2013년 1월 18일
I assume you get this from message from mlint. The only concern is if the function is used, but in a way that mlint cannot detect it. For example as a string in a callback.

댓글을 달려면 로그인하십시오.

답변 (3개)

Azzi Abdelmalek
Azzi Abdelmalek 2013년 1월 18일
편집: Azzi Abdelmalek 2013년 1월 18일

0 개 추천

All unused callback functions can be removed
Sean de Wolski
Sean de Wolski 2013년 1월 18일

0 개 추천

Yes, you can remove them. Just make sure there is no UItool that requires them first. I would recommend commenting followed by deletion if testing passes.
Jurgen
Jurgen 2013년 1월 18일

0 개 추천

Should not be a problem. Be careful that that message will appear on all your callbacks (local functions), even the ones you do use--assuming you used GUIDE to create the GUI.
You may also see a warning if the callback is not also removed from the properties of the respective uicontrol.

카테고리

도움말 센터File Exchange에서 App Building에 대해 자세히 알아보기

질문:

2013년 1월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by