1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| 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)
d{1, 1} = handles.name;
d{1, 2} = handles.age;
d{1, 3} = handles.weight;
d{1, 4} = handles.wu;
d{1, 5} = handles.height;
d{1, 6} = handles.hu;
d{1, 7} = handles.result;
d{1, 8} = handles.condition;
c = xlsread('bmi', 1 , 'b1');
position = ['a' num2str(c+3)];
[status, message] = xlswrite('bmi', d, 1, position);
if status
helpdlg('Data saved ok...', 'Save Spreadsheet');
else
errordlg('Could not save data', 'Save Spreadsheet');
end |
Partager