Reading cells extension wise in matlab.
1 次查看(过去 30 天)
显示 更早的评论
how to read the excel cells according to extension wise and how to count them? Foe an example, if I have this column
q.txt
w.txt
e.txt
r.exe
t.exe
and I want to count the number of txt file names as well as number of exe file names in the sheet. How to do so?
0 个评论
采纳的回答
Azzi Abdelmalek
2013-6-8
编辑:Azzi Abdelmalek
2013-6-8
A={'q.txt';'w.txt';'e.txt';'r.exe';'t.exe';'k.xls';'m.xls'}
% xls files
out_xls=A(cellfun(@(x) ~isempty(strfind(x,'.xls')),A))
% Number of txt file
nuber_txt=sum(cellfun(@(x) ~isempty(strfind(x,'.txt')),A))
更多回答(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!