フィルターのクリア

GUI - how to delete Matlab hidden auto calls to deleted objects

2 ビュー (過去 30 日間)
Blondeel
Blondeel 2012 年 2 月 21 日
コメント済み: mechE 2018 年 9 月 27 日
Hi,
Here is my problem : I modified my GUI and deleted some objects, but it seems Matlab did not notice that and keeps the links with them (I guess it is my fault).
When I launch the .m, Matlab delivers errors such Undefined function or method 'Target_Speed_CreateFcn' for input arguments of type 'double' The functions feval and gui_mainfcn are also lost with the disapeared object...
Into the code there is no more line with reference to my old object Target_Speed !
How to deal with this ?
Thank you very much if you can help me.
Regards,
Jerome
  2 件のコメント
Nathan Greco
Nathan Greco 2012 年 2 月 21 日
This is one example of why to avoid using GUIDE...
Walter Roberson
Walter Roberson 2012 年 2 月 21 日
Heh, yes, I was just popping in myself to write that my standard solution for this problem was to not use GUIDE.

サインインしてコメントする。

回答 (4 件)

Sean de Wolski
Sean de Wolski 2012 年 2 月 21 日
Undefined function or method 'Target_Speed_CreateFcn'
This would be indicating that you deleted the callback but not the object itself from the GUIDE editor. Open the figure in GUIDE and delete the object associated with Target_Speed. (or find tha object and double click on the auto callback in its property inspector so a new callback is generated.)

Walter Roberson
Walter Roberson 2012 年 2 月 21 日
Once you start designing in GUIDE, you are locked in to GUIDE or else you risk these kinds of problems -- and often the easiest solution for these kinds of problems is to recreate the GUI without copying and pasting anything.
I seem to recall that someone mentioned you can deal with these issues by using the Property Inspector and digging in to every single Callback. And using allchild() to look for hidden objects. And then hacking the Open function if need be. And never ever feed GUIDE after midnight.

Blondeel
Blondeel 2012 年 2 月 22 日
Thank you for your help. I was able to solve this issue by modifying the sections "Callback" and "CreateFcn" of the objects in the Inspector of the GUI (thanks Walter). Jerome
  1 件のコメント
mechE
mechE 2018 年 9 月 27 日
Can you please tell how did you modify the sections "Callback" and "CreateFcn" of the objects in the Inspector of the GUI

サインインしてコメントする。


zitongz
zitongz 2016 年 8 月 26 日
I felt I had the same issue and found this question but I later found out later that the object's function is named differently than its tag, often still the default names like edit2 or checkbox3. So I'm guessing that MATLAB did not update the function names when I changed the object's tag.
Well, I did not find this out by "digging in to every single Callback" as mentioned by Walter Roberson. Instead, I put in the following into the functions in question:
set(hObject, 'Visible', 'On', 'String', 'Where the hell are you?');
Then you run this GUIDE function and see where the troubled objects are.
Hope that helps.
Zitong

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by