How do you create a push button that saves data from a GUI?

조회 수: 3 (최근 30일)
deenessen armoogum
deenessen armoogum 2019년 6월 1일
댓글: deenessen armoogum 2019년 6월 5일
How to do it?

채택된 답변

Geoff Hayes
Geoff Hayes 2019년 6월 2일
편집: Geoff Hayes 2019년 6월 2일
deenessen - you haven't given us much to work on, but presumably your GUI has a button that, when pushed, you want to save some data to an Excel file. Assuming that GUIDE is being used, then your pushbutton callback would look like
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% get and format your data
myData = randi(42, 10,3);
% write your data to file
writematrix('myFile.xlsx', myData);
Depending upon your version of MATLAB, you could use writematrix or xlswrite.
  댓글 수: 10
deenessen armoogum
deenessen armoogum 2019년 6월 5일
I want to put all the coding in the pushbutton

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

deenessen armoogum
deenessen armoogum 2019년 6월 3일
Programmatically use gui I have already created the edit box and pushbutton so far

카테고리

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

제품


릴리스

R2007a

Community Treasure Hunt

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

Start Hunting!

Translated by