GUI 变量传递 handles


function uipushtool1_ClickedCallback(hObject,eventdata,handles)    %open the image file


filename = uigetfile('*.jpg', 'Select an image file');

im = imread(filename);

imagesc(im);

handles.im = im;        %define im in handles

%Update 

guidata(hObject, handles);


function pushbutton1_Callback(hObject, eventdata, handles)   %call the function


im = handles.im;      %get im from handles

findBallFunction(im);


你可能感兴趣的:(function,image,File,callback,IM)