0

我在matlab中实现uicontrol如下:

for m = 1: 10

    uicontrol(Fig_handle,'Style', 'pushbutton',...
    'String', sprintf('%s', ImgNames{m,2}),...
    'Tag', sprintf('%s', ImgNames{m,2}),...
    'Value', 0, 'Min',0, 'Max',1,...
    'Units','normalized','Position',[.01+(m-1)/15 .05 .05 .02],...
    'Callback', {@biomarker_Callback});


end

回调函数是:

   function biomarker_Callback(hObject, ~, ~)



  handles = guidata(hObject);


    for m = 1:size(handles.ImgNames)
        checkboxStatus = handles.Fig.(handles.ImgNames{m,2}).Value;
        if checkboxStatus ==1
            imh = imhandles(handles.Fig.screen);


            Image = ind2rgb(handles.Image_adjusted.(handles.ImgNames{m,1}), handles.ImgNames{m,6});
            set(imh,'CData',Image);
        end

    end
    end

执行时,我收到此错误:

Undefined function 'biomarker_Callback' for input arguments of type 'double'.


Error while evaluating uicontrol Callback

在打印我的值时,handles.Fig.(handles.ImgNames{m,2})我得到一个整数,虽然我期望列是值。同样,MATLAB R2015b 的运行也不会失败。

我不明白为什么会这样。有人可以帮我吗?

4

0 回答 0