MATLAB: How to find min and max gray level value in GUI

Image Processing Toolboxmatlab gui

I making GUI to find min and max gray level value. i do not know how to implement the function into the GUI.
<<
>>

Best Answer

Try this in your callback after the imshow() call:
minGL = min(X(:));
maxGL = max(X(:));
message = sprintf('The min gray level = %d.\nThe max gray level = %d.', minGL, maxGL);
uiwait(helpdlg(message));