how to save xcel file in two coloum in matlab using xlswrite
2 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
采纳的回答
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.
myFilename = 'myExcelFile.xls';
xlswrite(myFileName,data);
Try the above and see what happens!
0 个评论
更多回答(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!