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

1 visualización (últimos 30 días)
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 comentario
Stelios Fanourakis
Stelios Fanourakis el 9 de Feb. de 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

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by