What is this error about after am trying to indice an image out of a uibutton and uicontrols ?

1 回表示 (過去 30 日間)
I use this script
bg = uibuttongroup('Visible','off',...
'Position',[0 0 .2 1],...
'SelectionChangeFcn',@Do_plot, ...
'Tag', 'BG1');
handles.BG1 = bg;
guidata(bg, handles);
r1 = uicontrol(bg,'Style',...
'radiobutton',...
'String','Option 1',...
'Position',[10 350 100 30],...
'HandleVisibility','off');
r2 = uicontrol(bg,'Style','radiobutton',...
'String','Option 2',...
'Position',[10 250 100 30],...
'HandleVisibility','off');
% Make the uibuttongroup visible after creating child objects.
bg.Visible = 'on';
And this function in the end
function Do_plot(hObject, event, varargin)
bg = findobj(gcf, 'Tag', 'BG1');
sel = bg.SelectedObject;
if isempty(sel)
return; %no buttons selected
end
sel_string = sel.String;
switch sel_string
case 'Option 1'
bg.Value = croppedImage;
case 'Option 2'
bg.Value = J;
end
bg= double(bg);
end
And I get that error
Error using uint8
Conversion to uint8 from matlab.ui.container.ButtonGroup is not possible.
Error in ruller (line 181)
figure,imagesc(uint8(Img),[0 255]),colormap(gray),axis off;axis equal
>>
Why is that?
  1 件のコメント
Stelios Fanourakis
Stelios Fanourakis 2019 年 2 月 9 日
Or this error?
Error using contour (line 48)
Z must be at least a 2x2 matrix.
Error in ruller (line 193)
hold on,[c,h] = contour(phi,[0 0],'r','linewidth',1); hold off

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

回答 (0 件)

カテゴリ

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