How to save information in my GUI and resume the function

조회 수: 4 (최근 30일)
Brian Nguyen
Brian Nguyen 2021년 10월 25일
편집: Brian Nguyen 2021년 10월 25일
Hello!
So I have a GUI where it displays words of a sentence that is sourced from a list I have created, and the user is able to hit the toggle boxes and "score" the sentence where the data is save in a cell. However, I want to add a save feature since there are alot of sentences the user is scoring and I want them to have the ability to exit matlab and resume scoring where they left off the next day. Currently, my code below is what I am using to create a save file.
% --- Executes on button press in Save_button.
function Save_button_Callback(hObject, eventdata, handles)
% hObject handle to Save_button (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
global ID
C=date;
filename=strcat('Savefile_main',C)
path=fullfile('Data',ID,filename)% change to ID
savefig(path)
close all
However, there is an issue. If the user hits the save button and opens the savefile, they are able to resume where they left off (which is what I want), but if the user exits out of MATLAB and opens the save file; I get an error in the screenshot.
Any pointers to help me out? Let me know if more information is necessary to understand the problem. Thanks!

답변 (0개)

카테고리

Help CenterFile Exchange에서 Language Fundamentals에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by