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

1 view (last 30 days)
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',...
'String','Option 1',...
'Position',[10 350 100 30],...
r2 = uicontrol(bg,'Style','radiobutton',...
'String','Option 2',...
'Position',[10 250 100 30],...
% 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
sel_string = sel.String;
switch sel_string
case 'Option 1'
bg.Value = croppedImage;
case 'Option 2'
bg.Value = J;
bg= double(bg);
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 Comment
Stelios Fanourakis
Stelios Fanourakis on 9 Feb 2019
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

Sign in to comment.

Answers (0)

Community Treasure Hunt

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

Start Hunting!