I finally figured it out after banging my head against the wall forever, I'm not very fluent with matlab considering my orignal professor was fired because of lack of teaching and we've been rushed through the remainder of the semester. Here's my code to create a .mat file in the Submit_pushbutton_Callback of the first GUI
% --- Executes on button press in Submit_pushbutton.
function Submit_pushbutton_Callback(hObject, eventdata, handles)
% hObject handle to Submit_pushbutton (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
BlazerID = get(handles.BlazerID_edit, 'string'); %get blazer id that user entered
hour = get(handles.hours_uitable, 'data'); %get data from uitable
save(['C:\Users\jjtar\Desktop\GUI\Mat_File_Directory\' BlazerID '.mat'], 'hour', 'BlazerID'); %save file name = Blazer ID that was entered and save Data and BlazerID as variables
and here is my code in the opening function of the second GUI to get data from all of the .mat files that were created in the first GUI
for MyDirInfo = GetFileNames('C:\Users\jjtar\Desktop\GUI\Mat_File_Directory\');
for index = 1:numel(MyDirInfo) %Loop through for the number of files
GetFileName = MyDirInfo{index}; %Get string out of cell that includes name
MyDirName = strcat('C:\Users\jjtar\Desktop\GUI\Mat_File_Directory\',GetFileName); %Combine Directory location and file name
Data = matfile(MyDirName); %Get file Data
FileData=Data.hour; %Get .hour variable
end;
end;
Hopefully I help someone out that may be as lost as I am at using matlab
