How to change image of axes within a programmatic function?
1 次查看(过去 30 天)
显示 更早的评论
I tried changing the image of the axes (created with GUIDE) by using...
axes(handles.intro_chckbx_cmp)
imshow('check.png')
within a programmatically created function but it continues to give errors saying
Not enough input arguments.
Error while evaluating UIControl Callback
please help
0 个评论
回答(1 个)
Walter Roberson
2015-8-21
The problem is not those two lines of code.
You put those lines of code into a function, and you defined the function to take some number of parameters (such as 3 or 4), but when the function was called, you did not pass as many parameters as were needed.
I suspect that you defined the function to take 3 parameters, hObject, event, handles, as is usual for GUIDE, but that you did not let GUIDE create the Callback, that you either configured the uicontrol('Callback') yourself or that you used the property editor to edit the Callback of the uicontrol. MATLAB only automatically provides two parameters to callbacks, and does not automatically provide the handles parameter. When you use GUIDE to create the callback, it sets the Callback stored in the .fig to be a string that, when evaluated, finds the handles structure and passes it in to the real routine along with the two default parameters. If you set the Callback yourself or edited the properties of the uicontrol you probably did not set up the routine the same way and the function is probably only being called with two parameters.
另请参阅
类别
在 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!