Character in cell array, read and write
显示 更早的评论
Hello all,
I have a data in cell something like this:
1 BCS ACK/NACK 2054 0.00000 10.0000 Inside
[Note: actually I have 100 lines like above]
Now what I want to do is break this into different colum and save to excel sheet so that I can creat some graphs. Can anyone suggest how to, pls?
BR MJ
采纳的回答
更多回答(3 个)
MJ
2012-9-18
0 个投票
2 个评论
Azzi Abdelmalek
2012-9-18
Is there a problem with the code?
Azzi Abdelmalek
2012-9-18
编辑:Azzi Abdelmalek
2012-9-26
In case you have more then one blanck
A={'1 BCS ACK/NACK 2054 0.00000 10.0000';'1 BCS AK/NCK 2054 0.00 10.0000'}
res=cellfun(@(x) regexp(x,' ','split'),A,'uni',false)
out=[]
for k=1:numel(res)
q=res{k};
q(cellfun(@(x) length(x)==0,q))=[]
out=[out;q]
end
xlswrite('file.xls',out)
MJ
2012-9-28
2 个评论
Azzi Abdelmalek
2012-9-28
编辑:Azzi Abdelmalek
2012-9-28
format your code
can you post samples of your data?
MJ
2012-10-1
类别
在 帮助中心 和 File Exchange 中查找有关 Language Support 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!