MATLAB: Is it possible to declare and function within another function? if not, Look at the code below

functions

% --- Executes on button press in Browse1.
function Browse1_Callback(hObject, eventdata, handles)
ExPath1 = fullfile(FilePath, FileName)
set(handles.Filename1,'string',ExPath1)
%—————————————————————————–
(I am trying use the ExPath1 variable from my Browse function in my calculate function, IS IT POSSIBLE TO USE THE ExPath1 VARIABLE? because I need it in order to do the calculation.)
%-----------------------------------------------------------------------------
%Calculate button code
function Calculate1_Callback(~, ~, ~)
[x, error, stat1, stat2, stat3] = correctionModelworking1(ExPath1,'true',2,'true');

Best Answer

More specifically:
function Calculate1_Callback(~, ~, handles)
ExPath1 = get(handles.Filename1, 'string');
x, error, stat1, stat2, stat3] = correctionModelworking1(ExPath1,'true',2,'true');
Provided, that is, that your callback is being passed handles, as would be the case if you are using GUIDE.