MATLAB: Matlab pass recent loaded value to next gui

matlab gui

I'm new to matlab and i make two GUI using the guide, i get an error on my second GUI that variable is undefined. here is the code from first gui:
{
function load_image_Callback(hObject, eventdata, handles)
[Filename, Pathname] = uigetfile('*.*', 'Select leaf image');
% Data input; fetches for the image file.
leaf = fullfile(Pathname, Filename);
[y,x,z]=size(leaf);
if x>800
leaf=imresize(leaf,0.5);
end
}
the error says that 'leaf' is undefined. how can i fix this ? please help. thanks

Best Answer

leaf is destroyed at the end of the function. To pass it to the next function, see the FAQ:
Related Question