how to save xcel file in two coloum in matlab using xlswrite

조회 수: 1 (최근 30일)
Rohit Bhoi
Rohit Bhoi 2016년 1월 22일
답변: Geoff Hayes 2016년 1월 22일
I have GUI form and I in which there are 12 text box and 12 edit box. I want save this form using in excel format. first column should be all text boxes and second column should all edit box value. I obtained value using get(handle.tex) and get(handle.edit) value but enable to save. so have can I save this using xlswrite

채택된 답변

Geoff Hayes
Geoff Hayes 2016년 1월 22일
Rohit - what can you tell us about the data in the text and edit fields? Are they numeric or do they contain characters? If a combination of the two, you may want to create a 12x2 cell array where each element from the first column corresponds to one of the text boxes, and each element in the second column corresponds to one of the edit boxes. Something like the following should do
data = cell(12,2);
data{1,1} = char(get(handle.text1,'String')); % convert to number if needed with str2double
data{2,1} = char(get(handle.text2,'String'));
% etc.
data{1,2} = char(get(handles.edit1,'String'));
% etc.
Then use xlswrite to save to file
myFilename = 'myExcelFile.xls';
xlswrite(myFileName,data);
Try the above and see what happens!

추가 답변 (0개)

카테고리

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

태그

Community Treasure Hunt

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

Start Hunting!

Translated by