MATLAB: How to call the Excel sheet values to use in another pushbutton_callback for another algorithm in GUI

guiusing excel data

To use my excel sheet values i had used the commands
[filename, pathname]=uigetfile
FileNameString=strcat(pathname, filename) %Same as FullFileName
Yourdata=xlsread(FileNameString)
now i want to use 'Yourdata' values in another pushbutton_callback in which i am using a for loop.

Best Answer

[filename, pathname]=uigetfile
FileNameString=strcat(pathname, filename) %Same as FullFileName
Yourdata=xlsread(FileNameString)
handles.Yourdata=Yourdata
guidata(hObject,handles)
To get your data from another object
Yourdata=handles.Yourdata