MATLAB: Input and excel sheet and output a different one

excelgui

I would like to create an application that imports an excel sheet, modifies it (mainly transpose) and then exports it to a new excel sheet having the modified format. Explicit answers are appreciated. Thanks

Best Answer

Hello Michel,
Create a GUI for the same. Add one Push Button, So that when you click on that Pushbutton, it will import the excel file (ABC.xlsx), it will read it, it will store the data into some Array variables, it will modify it as per your requirement, it will then write the modified data into another excel (XYZ.xlsx).
Code will be as follows:
% --- Executes on button press in OK_.
function OK__Callback(hObject, eventdata, handles)
% hObject handle to OK_ (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
importData = xlsread('ABC.xlsx');
modifiedData = 2 * importData + 100;
xlswrite('XYZ.xlsx',modifiedData;
winopen('XYZ.xlsx');
Note: The both excel files should be present in current directory.
Related Question