how to write xls file
2 次查看(过去 30 天)
显示 更早的评论
Hi i want to write xls file using the below code i am able to write numeric data.i want to write header also.please guide how to proceed
data=get(handles.uitable1,'data');
checkbox1State = get(handles.af1, 'Value');
checkbox2State = get(handles.af2, 'Value');
checkbox3State = get(handles.af3, 'Value');
if checkbox1State
header={'first'}
p=data(start_pt:end_pt,1);
xlswrite('af1.xls',p,1,'A2');
end
if checkbox2State
header={'second'}
p=data(start_pt:end_pt,2);
xlswrite('af1.xls',p,1,'B2')
end
if checkbox3State
header={'third'}
p=data(start_pt:end_pt,3);
xlswrite('af1.xls',p,1,'C2')
end
0 个评论
采纳的回答
Azzi Abdelmalek
2013-3-4
编辑:Azzi Abdelmalek
2013-3-4
x=[1;2;3]; % first column
y=[10;20;30] ;% second column
header={'x','y'}
M=[header ; num2cell([x y])]
xlswrite('filname.xls',M)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!