???使用 ==> 设置传递给 'CurrentAxes' 属性 的 uicontrol 句柄时出错 - 需要有效的轴句柄

??? Error using ==> set uicontrol handle passed to 'CurrentAxes' property - valid axes handle required

可以帮我解决问题。我正在用 matlab 创建图像处理算法,但发现错误:

??? Error using ==> set
uicontrol handle passed to 'CurrentAxes' property - valid axes handle required

这是代码:

set(iniw.figure1,'CurrentAxes',iniw.Cover_Image);

根据变量的命名,您正在尝试将图形的 CurrentAxes 设置为...图像。 axes 是一个容器,其中 包含 图像对象。您需要先获取包含图像的 axes 并将 that 设置为 CurrentAxes。您可以使用 ancestor.

来确定
 set(iniw.figure1, 'CurrentAxes', ancestor(iniw.Cover_Image, 'axes'))