2011-09-10, 17:22
global im%使用全局变量im
%拿到你所选择的按钮的名称
str=get(hObject,'string');
axes(handles,axes1);
switch str
case '原图'
imshow(im);
case 'sobel'
BW=edge(rgb2gray(im),'sobel');
imshow(BW);
case 'prewitt'
BW=edge(rgb2gray(im),'prewitt');
imshow(BW);
case 'canny'
BW=edge(rgb2gray(im),'canny');
imshow(BW);
end;
为什么运行这段代码,点击‘sobel’‘prewitt’‘canny’时;
matlab的command window 会总是出现Error while evaluating uicontrol Callback错误啊
求解啊:confused:
%拿到你所选择的按钮的名称
str=get(hObject,'string');
axes(handles,axes1);
switch str
case '原图'
imshow(im);
case 'sobel'
BW=edge(rgb2gray(im),'sobel');
imshow(BW);
case 'prewitt'
BW=edge(rgb2gray(im),'prewitt');
imshow(BW);
case 'canny'
BW=edge(rgb2gray(im),'canny');
imshow(BW);
end;
为什么运行这段代码,点击‘sobel’‘prewitt’‘canny’时;
matlab的command window 会总是出现Error while evaluating uicontrol Callback错误啊
求解啊:confused: