function pushbutton1_Callback(hObject, eventdata, handles)global X;[filename, pathname] = uigetfile({'*.bmp','All Image Files';... '*.*','All Files' },'title',... 'D:\MRI\DOI');X = imread([pathname,filename]);axes(handles.axes1);imshow(X);minGL = min(X(:));maxGL = max(X(:));meanGL = mean(X(:));message = sprintf('The min gray level = %d.\nThe max gray level = %d.\nThe mean gray level = %d.', minGL, maxGL,meanGL);uiwait(helpdlg(message));
I try to find a mean gray level value in GUI. When i run the code it will give this answer:
What wrong with the code?
Best Answer