How can I export data to excel from a GUI (created using GUIDE) using a push button
9 ビュー (過去 30 日間)
古いコメントを表示
I use the pushbutton to collect the data entered in each element of the GUI. I want to export the data to excel when i press the pushbutton
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)
hCheckboxes= [handles.checkbox19 ; handles.checkbox20 ; handles.checkbox21 ;handles.checkbox22;...
handles.checkbox23 ; handles.checkbox24 ];
checkboxValues = get(hCheckboxes, 'Value')
cough = get(handles.chCough, 'Value');
dry_cough = get(handles.chDryCough, 'Value');
head_ache = get(handles.chHeadache, 'Value');
sore_throat = get(handles.chSoreThroat, 'Value');
chill = get(handles.chCFever, 'Value');
mild_fever = get(handles.chFever, 'Value');
severe_fever = get(handles.chSFever, 'Value');
loss_smelltaste = get(handles.chLST, 'Value');
shrotness_breath = get(handles.chShBreath, 'Value');
muscular_ache = get(handles.chMuscular, 'Value');
others = get(handles.chOthers, 'Value');
city = get(handles.chCity, 'String
name = get(handles.edit2, 'String')
lastname = get(handles.edit7, 'String');
age = get(handles.edit3, 'String')
info_adicional = get(handles.edit5, 'String');
4 件のコメント
Rik
2020 年 5 月 17 日
Sure, although I would first check what syntax xlswrite needs. Then you can tailor the way you put it into an array to that.
回答 (1 件)
Jyotsna Talluri
2020 年 5 月 19 日
Create a cell array of all the variables and export the cell array to excel file which is created in the same directory using xlswrite.
arr = {cough,dry_cough,head_ache,sore_throat,chill,mild_fever,severe_fever,...};
xlswrite('new.xlsx',arr);
Refer to the below link for more inormation
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Spreadsheets についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!