MATLAB: How to call the detected eye function on other push button

calling matlab function in push button

function pushbutton3_Callback(hObject, eventdata, handles)
selectedFile = handles.selectedFile;
EyeDetect = vision.CascadeObjectDetector('EyePairBig');
I = imread(selectedFile);
BB=step(EyeDetect,I);
axes(handles.axes2);
imshow(I); hold on
for i = 1:size(BB,1)
rectangle('Position',BB(i,:),'LineWidth',2,'LineStyle','-','EdgeColor','r');
end
hold off;
Related Question