how i can get the first and second letters in cell data
显示 更早的评论
hello all;
i want to get the first and second letters of each row
letters={'Aliadan';'FadumoHassan'; 'Buraaleabi';'kadradahir'};
so, how i can assign first charac of each row in one vector and the second character in each row in another vector.
采纳的回答
更多回答(2 个)
Purushottama Rao
2015-5-16
编辑:Purushottama Rao
2015-5-16
for k=1:4
f(k)=letters{k}(1);
end
for k=1:4
g(k)=letters{k}(2);
end
singh
2015-5-16
for k=1:length(letters)
f(k)=letters{k}(1)
g(k)=letters{k}(2)
end
类别
在 帮助中心 和 File Exchange 中查找有关 Cell Arrays 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!